findStructuralBytes returns the positions of all bytes in data that match any of targets. Returns nil if none are found.
(data []byte, targets ...byte)
| 552 | // findStructuralBytes returns the positions of all bytes in data that match |
| 553 | // any of targets. Returns nil if none are found. |
| 554 | func findStructuralBytes(data []byte, targets ...byte) []int { |
| 555 | var pos []int |
| 556 | for i, b := range data { |
| 557 | for _, t := range targets { |
| 558 | if b == t { |
| 559 | pos = append(pos, i) |
| 560 | break |
| 561 | } |
| 562 | } |
| 563 | } |
| 564 | return pos |
| 565 | } |
| 566 | |
| 567 | // truncateAtValueBoundary cuts the document right after a ':' (before the |
| 568 | // value starts). This is the OSS-Fuzz 4649128545288192 / |
no outgoing calls
no test coverage detected