Skip to content

Commit eefe289

Browse files
committed
Merge remote-tracking branch 'origin/fix-left-function-compare' into fix-left-function-compare
2 parents 49609c0 + 6cbd9f1 commit eefe289

3 files changed

Lines changed: 34 additions & 34 deletions

File tree

src/Hyperbee.Json/Path/JsonPath.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ private static IEnumerable<TNode> EnumerateMatches( TNode root, NodeArgs args, N
160160
var (parent, value, key, segmentNext, flags) = args;
161161

162162
ProcessArgs:
163-
// call node processor if it exists and the `key` is not null.
164-
// the key is null when a descent has re-pushed the descent target.
165-
// this should be safe to skip; we will see its values later.
163+
// call node processor if it exists and the `key` is not null.
164+
// the key is null when a descent has re-pushed the descent target.
165+
// this should be safe to skip; we will see its values later.
166166

167167
if ( key != null )
168168
processor?.Invoke( parent, value, key, segmentNext );

test/Hyperbee.Json.Benchmark/JsonPathBenchmark.cs

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Text.Json;
1+
using System.Text.Json;
22
using System.Text.Json.Nodes;
33
using BenchmarkDotNet.Attributes;
44
using BenchmarkDotNet.Engines;
@@ -24,46 +24,46 @@ public class JsonPathBenchmark
2424

2525
[Params(
2626
// Root and Wildcard
27-
"$",
27+
"$",
2828
"$.store.*",
2929
"$.store.* #First()", // Test Enumerable.First()
3030

3131
// Property and Index Access
32-
"$.store.book[0]",
33-
"$.store.book[0].title",
34-
"$.store.book[*]",
35-
"$.store.book[*].author",
36-
"$.store.book['category','author']",
32+
"$.store.book[0]",
33+
"$.store.book[0].title",
34+
"$.store.book[*]",
35+
"$.store.book[*].author",
36+
"$.store.book['category','author']",
3737

3838
// Recursive Descent
39-
"$.store..price",
40-
"$..author",
41-
"$..*",
42-
"$..['bicycle','price']",
43-
"$..book[0,1]",
44-
"$..book[?@.isbn]",
39+
"$.store..price",
40+
"$..author",
41+
"$..*",
42+
"$..['bicycle','price']",
43+
"$..book[0,1]",
44+
"$..book[?@.isbn]",
4545

4646
// Filters
47-
"$.store.book[?(@.price < 10)].title",
48-
"$.store.book[?(@.price > 10 && @.price < 20)]",
49-
"$.store.book[?(@.category == 'fiction')]",
50-
"$.store.book[?(@.author && @.title)]",
51-
"$.store.book[?(@.price == 8.99)]",
52-
"$..[?(@.price < 10)]",
53-
"$..book[?@.price == 8.99 && @.category == 'fiction']",
54-
"$.store.book[?(@.price < 10 || @.category == 'fiction')]",
55-
"$.store.book[?(!@.isbn)]",
56-
"$.store.book[?(length(@.title) > 10)]",
57-
47+
"$.store.book[?(@.price < 10)].title",
48+
"$.store.book[?(@.price > 10 && @.price < 20)]",
49+
"$.store.book[?(@.category == 'fiction')]",
50+
"$.store.book[?(@.author && @.title)]",
51+
"$.store.book[?(@.price == 8.99)]",
52+
"$..[?(@.price < 10)]",
53+
"$..book[?@.price == 8.99 && @.category == 'fiction']",
54+
"$.store.book[?(@.price < 10 || @.category == 'fiction')]",
55+
"$.store.book[?(!@.isbn)]",
56+
"$.store.book[?(length(@.title) > 10)]",
57+
5858

5959
// Array Slices and Unions
60-
"$.store.book[-1:]",
61-
"$.store.book[0,1]",
62-
"$.store.book[:2]",
63-
"$.store.book[0:3:2]",
60+
"$.store.book[-1:]",
61+
"$.store.book[0,1]",
62+
"$.store.book[:2]",
63+
"$.store.book[0:3:2]",
6464

6565
// Property Access (Direct)
66-
"$.store.bicycle.color"
66+
"$.store.bicycle.color"
6767
)]
6868
public string Filter;
6969

test/Hyperbee.Json.Tests/Path/Parser/FilterParserTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ public void ReturnExpectedResult_WhenUsingExpressionEvaluator( string filter, fl
123123
}
124124

125125
[DataTestMethod]
126-
[DataRow( "$.store.book[?(length(@.title) > 10)].title", "Sayings of the Century", typeof(JsonElement) )]
127-
[DataRow( "$.store.book[?(length(@.title) > 10)].title", "Sayings of the Century", typeof(JsonNode) )]
126+
[DataRow( "$.store.book[?(length(@.title) > 10)].title", "Sayings of the Century", typeof( JsonElement ) )]
127+
[DataRow( "$.store.book[?(length(@.title) > 10)].title", "Sayings of the Century", typeof( JsonNode ) )]
128128
public void ReturnExpectedResult_WhenUsingExpressionEvaluator( string filter, string expected, Type sourceType )
129129
{
130130
// arrange & act

0 commit comments

Comments
 (0)