Cache the result of goog.object.getCount
This commit is contained in:
@@ -124,10 +124,9 @@ ol.pointer.TouchSource.prototype.isPrimaryTouch_ = function(inTouch) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.pointer.TouchSource.prototype.setPrimaryTouch_ = function(inTouch) {
|
ol.pointer.TouchSource.prototype.setPrimaryTouch_ = function(inTouch) {
|
||||||
if (goog.object.getCount(this.pointerMap) === 0 ||
|
var count = goog.object.getCount(this.pointerMap);
|
||||||
(goog.object.getCount(this.pointerMap) === 1 &&
|
if (count === 0 || (count === 1 && goog.object.containsKey(this.pointerMap,
|
||||||
goog.object.containsKey(this.pointerMap,
|
ol.pointer.MouseSource.POINTER_ID.toString()))) {
|
||||||
ol.pointer.MouseSource.POINTER_ID.toString()))) {
|
|
||||||
this.firstTouchId_ = inTouch.identifier;
|
this.firstTouchId_ = inTouch.identifier;
|
||||||
this.cancelResetClickCount_();
|
this.cancelResetClickCount_();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user