Closed jbasilico closed 5 years ago
Avoiding doing a lookup on setting a value in a SparseVector each time, since that requires 2 lookups, which makes it slow. Instead, only do the check when the value passed in is 0 to avoid adding a 0 element to the underlying vector.
Avoiding doing a lookup on setting a value in a SparseVector each time, since that requires 2 lookups, which makes it slow. Instead, only do the check when the value passed in is 0 to avoid adding a 0 element to the underlying vector.