Saturate rather than failing on index bounds in list.insert()
This commit is contained in:
parent
ab0418fec6
commit
81c570686b
@ -118,7 +118,7 @@ KRK_Method(list,insert) {
|
||||
METHOD_TAKES_EXACTLY(2);
|
||||
CHECK_ARG(1,int,krk_integer_type,index);
|
||||
pthread_rwlock_wrlock(&self->rwlock);
|
||||
LIST_WRAP_INDEX();
|
||||
LIST_WRAP_SOFT(index);
|
||||
krk_writeValueArray(&self->values, NONE_VAL());
|
||||
memmove(
|
||||
&self->values.values[index+1],
|
||||
|
Loading…
Reference in New Issue
Block a user