MCPcopy Create free account
hub / github.com/dolthub/doltgresql / RemoveIndex

Method RemoveIndex

postgres/parser/json/json.go:1447–1462  ·  view source on GitHub ↗
(idx int)

Source from the content-addressed store, hash-verified

1445}
1446
1447func (j jsonArray) RemoveIndex(idx int) (JSON, bool, error) {
1448 if idx < 0 {
1449 idx = len(j) + idx
1450 }
1451 if idx < 0 || idx >= len(j) {
1452 return j, false, nil
1453 }
1454 result := make(jsonArray, len(j)-1)
1455 for i := 0; i < idx; i++ {
1456 result[i] = j[i]
1457 }
1458 for i := idx + 1; i < len(j); i++ {
1459 result[i-1] = j[i]
1460 }
1461 return result, true, nil
1462}
1463
1464func (j jsonObject) RemoveIndex(int) (JSON, bool, error) {
1465 return nil, false, errCannotDeleteFromObject

Callers 1

doRemovePathMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected