MCPcopy Index your code
hub / github.com/maruel/panicparse / similar

Method similar

stack/stack.go:184–216  ·  view source on GitHub ↗

similar returns true if the two Arg are equal or almost but not quite equal.

(r *Arg, similar Similarity)

Source from the content-addressed store, hash-verified

182
183// similar returns true if the two Arg are equal or almost but not quite equal.
184func (a *Arg) similar(r *Arg, similar Similarity) bool {
185 if a.IsAggregate != r.IsAggregate {
186 return false
187 }
188 if a.IsAggregate {
189 return a.Fields.similar(&r.Fields, similar)
190 }
191 switch similar {
192 case ExactFlags, ExactLines:
193 if a.Name != r.Name {
194 return false
195 }
196 if a.IsOffsetTooLarge != r.IsOffsetTooLarge {
197 return false
198 }
199 if a.IsPtr != r.IsPtr {
200 return false
201 }
202 return a.Value == r.Value
203 case AnyValue:
204 return true
205 case AnyPointer:
206 if a.IsOffsetTooLarge != r.IsOffsetTooLarge {
207 return false
208 }
209 if a.IsPtr != r.IsPtr {
210 return false
211 }
212 return a.IsPtr || a.Value == r.Value
213 default:
214 return false
215 }
216}
217
218// Args is a series of function call arguments.
219type Args struct {

Callers 6

equalMethod · 0.95
TestSignature_SimilarFunction · 0.45
similarMethod · 0.45
similarMethod · 0.45
similarMethod · 0.45
similarMethod · 0.45

Calls

no outgoing calls

Tested by 1

TestSignature_SimilarFunction · 0.36