@@ -95,16 +95,7 @@ internal class TrieNode<E>(
95
95
return buffer[index] as TrieNode <E >
96
96
}
97
97
98
- private fun addElementAt (positionMask : Int , element : E ): TrieNode <E > {
99
- // assert(hasNoCellAt(positionMask))
100
-
101
- val index = indexOfCellAt(positionMask)
102
- val newBitmap = bitmap or positionMask
103
- val newBuffer = buffer.addElementAtIndex(index, element)
104
- return setProperties(newBitmap, newBuffer, owner = null )
105
- }
106
-
107
- private fun mutableAddElementAt (positionMask : Int , element : E , owner : MutabilityOwnership ): TrieNode <E > {
98
+ private fun addElementAt (positionMask : Int , element : E , owner : MutabilityOwnership ? ): TrieNode <E > {
108
99
// assert(hasNoCellAt(positionMask))
109
100
110
101
val index = indexOfCellAt(positionMask)
@@ -708,7 +699,7 @@ internal class TrieNode<E>(
708
699
val cellPositionMask = 1 shl indexSegment(elementHash, shift)
709
700
710
701
if (hasNoCellAt(cellPositionMask)) { // element is absent
711
- return addElementAt(cellPositionMask, element)
702
+ return addElementAt(cellPositionMask, element, owner = null )
712
703
}
713
704
714
705
val cellIndex = indexOfCellAt(cellPositionMask)
@@ -732,7 +723,7 @@ internal class TrieNode<E>(
732
723
733
724
if (hasNoCellAt(cellPosition)) { // element is absent
734
725
mutator.size++
735
- return mutableAddElementAt (cellPosition, element, mutator.ownership)
726
+ return addElementAt (cellPosition, element, mutator.ownership)
736
727
}
737
728
738
729
val cellIndex = indexOfCellAt(cellPosition)
0 commit comments