Inline simple goog.isDef() checks

This commit is contained in:
Tim Schaub
2015-09-27 10:18:44 -06:00
parent cf5eadebaa
commit 7659e47e07
22 changed files with 59 additions and 59 deletions
+4 -4
View File
@@ -16,7 +16,7 @@ ol.RotationConstraintType;
* @return {number|undefined} Rotation.
*/
ol.RotationConstraint.disable = function(rotation, delta) {
if (goog.isDef(rotation)) {
if (rotation !== undefined) {
return 0;
} else {
return undefined;
@@ -30,7 +30,7 @@ ol.RotationConstraint.disable = function(rotation, delta) {
* @return {number|undefined} Rotation.
*/
ol.RotationConstraint.none = function(rotation, delta) {
if (goog.isDef(rotation)) {
if (rotation !== undefined) {
return rotation + delta;
} else {
return undefined;
@@ -51,7 +51,7 @@ ol.RotationConstraint.createSnapToN = function(n) {
* @return {number|undefined} Rotation.
*/
function(rotation, delta) {
if (goog.isDef(rotation)) {
if (rotation !== undefined) {
rotation = Math.floor((rotation + delta) / theta + 0.5) * theta;
return rotation;
} else {
@@ -74,7 +74,7 @@ ol.RotationConstraint.createSnapToZero = function(opt_tolerance) {
* @return {number|undefined} Rotation.
*/
function(rotation, delta) {
if (goog.isDef(rotation)) {
if (rotation !== undefined) {
if (Math.abs(rotation + delta) <= tolerance) {
return 0;
} else {