function update(evt) {
        if (evt && evt.defaultPrevented) return;
        function check(rule) {
          var handled = rule($injector, $location);
          if (handled) {
            if (isString(handled)) $location.replace().url(handled);
            return true;
          }
          return false;
        }
        var n=rules.length, i;
        for (i=0; i<n; i++) {
          if (check(rules[i])) return;
        }
        // always check otherwise last to allow dynamic updates to the set of rules
        if (otherwise) check(otherwise);
      }
// TODO: Optimize groups of rules with non-empty prefix into some sort of decision tree
Optimize groups of rules with non-empty prefix into some sort of decision tree
Optimize groups of rules with non - empty prefix into some sort of decision tree
function update(evt) {
        if (evt && evt.defaultPrevented) return;
        function check(rule) {
          var handled = rule($injector, $location);
          if (handled) {
            if (isString(handled)) $location.replace().url(handled);
            return true;
          }
          return false;
        }
        var n=rules.length, i;
        for (i=0; i<n; i++) {
          if (check(rules[i])) return;
        }
        if (otherwise) check(otherwise);
      }
function update ( evt ) { if ( evt && evt . defaultPrevented ) return ; function check ( rule ) { var handled = rule ( $injector , $location ) ; if ( handled ) { if ( isString ( handled ) ) $location . replace ( ) . url ( handled ) ; return true ; } return false ; } var n = rules . length , i ; for ( i = 0 ; i < n ; i ++ ) { if ( check ( rules [ i ] ) ) return ; } if ( otherwise ) check ( otherwise ) ; }
TODO: Optimize groups of rules with non-empty prefix into some sort of decision tree
TODO : Optimize groups of rules with non - empty prefix into some sort of decision tree
// always check otherwise last to allow dynamic updates to the set of rules