Example #1
0
        public PathBranch FindOrAddChildByToken(RouteToken token)
        {
            var key        = GetKey(token);
            var pathBranch = FindChild(key);

            if (pathBranch != null)
            {
                return(pathBranch);
            }
            pathBranch = new PathBranch {
                Token = token
            };
            ChildrenDict[key] = pathBranch;
            return(pathBranch);
        }
Example #2
0
 private static string GetKey(RouteToken token) =>
 token.Text ?? Utils.ComputeHash(token.Hasher);
Example #3
0
 public PathBranch FindChild(RouteToken token) =>
 FindChild(GetKey(token));
Example #4
0
 public RouteTokenHasher(RouteToken token) => _token = token;