File tree Expand file tree Collapse file tree 3 files changed +5
-10
lines changed Expand file tree Collapse file tree 3 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -1143,8 +1143,6 @@ func (d *Decoder) StackIndex(i int) (Kind, int64) {
1143
1143
}
1144
1144
1145
1145
// StackPointer returns a JSON Pointer (RFC 6901) to the most recently read value.
1146
- // Object names are only present if [AllowDuplicateNames] is false, otherwise
1147
- // object members are represented using their index within the object.
1148
1146
func (d * Decoder ) StackPointer () Pointer {
1149
1147
return Pointer (d .s .AppendStackPointer (nil , - 1 ))
1150
1148
}
Original file line number Diff line number Diff line change @@ -947,8 +947,6 @@ func (e *Encoder) StackIndex(i int) (Kind, int64) {
947
947
}
948
948
949
949
// StackPointer returns a JSON Pointer (RFC 6901) to the most recently written value.
950
- // Object names are only present if [AllowDuplicateNames] is false, otherwise
951
- // object members are represented using their index within the object.
952
950
func (e * Encoder ) StackPointer () Pointer {
953
951
return Pointer (e .s .AppendStackPointer (nil , - 1 ))
954
952
}
Original file line number Diff line number Diff line change @@ -55,7 +55,6 @@ type state struct {
55
55
Tokens stateMachine
56
56
57
57
// Names is a stack of object names.
58
- // Not used if AllowDuplicateNames is true.
59
58
Names objectNameStack
60
59
61
60
// Namespaces is a stack of object namespaces.
@@ -107,11 +106,11 @@ func (p Pointer) IsValid() bool {
107
106
return len (p ) == 0 || p [0 ] == '/'
108
107
}
109
108
110
- // Contains reports whether the JSON value that p1 points to
111
- // is equal to or contains the JSON value that p2 points to.
112
- func (p1 Pointer ) Contains (p2 Pointer ) bool {
113
- // Invariant: len(p1 ) <= len(p2 ) if p1 .Contains(p2 )
114
- suffix , ok := strings .CutPrefix (string (p2 ), string (p1 ))
109
+ // Contains reports whether the JSON value that p points to
110
+ // is equal to or contains the JSON value that pc points to.
111
+ func (p Pointer ) Contains (pc Pointer ) bool {
112
+ // Invariant: len(p ) <= len(pc ) if p .Contains(pc )
113
+ suffix , ok := strings .CutPrefix (string (pc ), string (p ))
115
114
return ok && (suffix == "" || suffix [0 ] == '/' )
116
115
}
117
116
You can’t perform that action at this time.
0 commit comments