From fa1f4eb1a044a71b925012ad4a4fd89d23cc0deb Mon Sep 17 00:00:00 2001 From: Brenton Farmer Date: Mon, 10 Jun 2024 10:46:20 -0700 Subject: [PATCH] small cleanups to comments and method signatures --- src/Hyperbee.Json/JsonPathBuilder.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Hyperbee.Json/JsonPathBuilder.cs b/src/Hyperbee.Json/JsonPathBuilder.cs index 77dbb8c4..192a2939 100644 --- a/src/Hyperbee.Json/JsonPathBuilder.cs +++ b/src/Hyperbee.Json/JsonPathBuilder.cs @@ -17,13 +17,13 @@ public JsonPathBuilder( JsonElement rootElement ) { _rootElement = rootElement; - // we will avoid allocating full paths for every node by - // building a dictionary cache of (parentId, segment) pairs. + // avoid allocating full paths for every node by building + // a dictionary of (parentId, segment) pairs. _parentMap[GetUniqueId( _rootElement )] = (-1, "$"); // seed parent map with root } - public string GetPath( JsonElement targetElement ) + public string GetPath( in JsonElement targetElement ) { // quick out @@ -77,12 +77,12 @@ public string GetPath( JsonElement targetElement ) return null; // target not found } - private static int GetUniqueId( JsonElement element ) + private static int GetUniqueId( in JsonElement element ) { return JsonElementInternal.GetIdx( element ); } - private static string BuildPath( int elementId, Dictionary parentMap ) + private static string BuildPath( in int elementId, Dictionary parentMap ) { var pathSegments = new Stack(); var currentId = elementId;