]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/router.js
Reduce condition complexity
[rails.git] / app / assets / javascripts / router.js
index 30a71e0f179d6dd1bd3fc0c0f228ab675573cce6..63a320c6a9d76e6a2810289d4f105e448d788a72 100644 (file)
@@ -142,11 +142,8 @@ OSM.Router = function (map, rts) {
   };
 
   router.stateChange = function (state) {
   };
 
   router.stateChange = function (state) {
-    if (state.center) {
-      window.history.replaceState(state, document.title, OSM.formatHash(state));
-    } else {
-      window.history.replaceState(state, document.title, window.location);
-    }
+    const url = state.center ? OSM.formatHash(state) : window.location;
+    window.history.replaceState(state, document.title, url);
   };
 
   router.updateHash = function () {
   };
 
   router.updateHash = function () {