@@ -32,10 +32,10 @@ func (cd *Cedar) get(key []byte, from, pos int) *int {
3232 return & cd .array [to ].baseV
3333}
3434
35- // GetVal get follow node by key, split by update()
36- func (cd * Cedar ) getNode (key []byte , from , pos int , redched ... bool ) int {
35+ // getNode get follow node by key, split by update()
36+ func (cd * Cedar ) getNode (key []byte , from , pos int , reduced ... bool ) int {
3737 for ; pos < len (key ); pos ++ {
38- if isReduced (redched ... ) {
38+ if isReduced (reduced ... ) {
3939 value := cd .array [from ].baseV
4040 if value >= 0 && value != ValLimit {
4141 to := cd .follow (from , 0 )
@@ -47,7 +47,7 @@ func (cd *Cedar) getNode(key []byte, from, pos int, redched ...bool) int {
4747 }
4848
4949 to := from
50- if cd .array [from ].baseV < 0 || ! isReduced (redched ... ) {
50+ if cd .array [from ].baseV < 0 || ! isReduced (reduced ... ) {
5151 to = cd .follow (from , 0 )
5252 }
5353
@@ -122,10 +122,10 @@ func (cd *Cedar) Insert(key []byte, val int) error {
122122}
123123
124124// Update the key for the value, it is public interface that works on &str
125- func (cd * Cedar ) Update (key []byte , value int , redched ... bool ) error {
125+ func (cd * Cedar ) Update (key []byte , value int , reduced ... bool ) error {
126126 p := cd .get (key , 0 , 0 )
127127
128- if * p == ValLimit && isReduced (redched ... ) {
128+ if * p == ValLimit && isReduced (reduced ... ) {
129129 * p = value
130130 return nil
131131 }
@@ -135,27 +135,27 @@ func (cd *Cedar) Update(key []byte, value int, redched ...bool) error {
135135}
136136
137137// Delete the key from the trie, the internal interface that works on &[u8]
138- func (cd * Cedar ) Delete (key []byte , redched ... bool ) error {
138+ func (cd * Cedar ) Delete (key []byte , reduced ... bool ) error {
139139 // move the cursor to the right place and use erase__ to delete it.
140140 to , err := cd .Jump (key , 0 )
141141 if err != nil {
142142 return ErrNoKey
143143 }
144144
145- if cd .array [to ].baseV < 0 && isReduced (redched ... ) {
145+ if cd .array [to ].baseV < 0 && isReduced (reduced ... ) {
146146 base := cd .array [to ].base ()
147147 if cd .array [base ].check == to {
148148 to = base
149149 }
150150 }
151151
152- if ! isReduced (redched ... ) {
152+ if ! isReduced (reduced ... ) {
153153 to = cd .array [to ].base ()
154154 }
155155
156156 from := to
157157 for to > 0 {
158- if isReduced (redched ... ) {
158+ if isReduced (reduced ... ) {
159159 from = cd .array [to ].check
160160 }
161161 base := cd .array [from ].base ()
0 commit comments