-
Notifications
You must be signed in to change notification settings - Fork 0
/
vector_legacy.go
57 lines (49 loc) · 1.61 KB
/
vector_legacy.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package vector
import "unsafe"
// ParseStr is a legacy version of ParseString.
// DEPRECATED: use ParseString instead.
func (vec *Vector) ParseStr(_ string) error {
return ErrNotImplement
}
// ParseCopyStr is a legacy version of ParseCopyString.
// DEPRECATED: use ParseCopyString instead.
func (vec *Vector) ParseCopyStr(_ string) error {
return ErrNotImplement
}
// GetNode is a legacy version of AcquireNode.
// DEPRECATED: use AcquireNode instead.
func (vec *Vector) GetNode(depth int) (node *Node, idx int) {
node, idx = vec.ackNode(depth)
vec.Index.Register(depth, idx)
return
}
// GetNodeWT is a legacy version of AcquireNodeWithType.
// DEPRECATED: use AcquireNodeWithType instead.
func (vec *Vector) GetNodeWT(depth int, typ Type) (*Node, int) {
node, idx := vec.AcquireNode(depth)
node.typ = typ
return node, idx
}
// GetChild is a legacy version of AcquireChild.
// DEPRECATED: use AcquireChild instead.
func (vec *Vector) GetChild(root *Node, depth int) (*Node, int) {
return vec.AcquireChildWithType(root, depth, TypeUnknown)
}
// GetChildWT is a legacy version of AcquireChildWithType.
// DEPRECATED: use AcquireChildWithType instead.
func (vec *Vector) GetChildWT(root *Node, depth int, typ Type) (*Node, int) {
node, idx := vec.ackNode(depth)
node.typ = typ
node.pptr = root.ptr()
root.SetLimit(vec.Index.Register(depth, idx))
return node, idx
}
// PutNode is a legacy version of ReleaseNode.
// DEPRECATED: use ReleaseNode instead.
func (vec *Vector) PutNode(idx int, node *Node) {
l := unsafe.Pointer(&vec.nodes[idx])
r := unsafe.Pointer(node)
if uintptr(l) != uintptr(r) {
vec.nodes[idx] = *node
}
}