| 355 | } |
| 356 | |
| 357 | void ArrayBase::Splice(ArrayBase *outResult,int inPos,int inLen) |
| 358 | { |
| 359 | if (inPos>=length) |
| 360 | { |
| 361 | return; |
| 362 | } |
| 363 | else if (inPos<0) |
| 364 | { |
| 365 | inPos += length; |
| 366 | if (inPos<0) |
| 367 | inPos =0; |
| 368 | } |
| 369 | if (inLen<=0) |
| 370 | return; |
| 371 | if (inPos+inLen>length) |
| 372 | inLen = length - inPos; |
| 373 | |
| 374 | int s = GetElementSize(); |
| 375 | if (outResult) |
| 376 | { |
| 377 | outResult->resize(inLen); |
| 378 | memcpy(outResult->mBase, mBase+inPos*s, s*inLen); |
| 379 | // todo - only needed if we have dirty pointer elements |
| 380 | HX_OBJ_WB_PESSIMISTIC_GET(outResult); |
| 381 | } |
| 382 | memmove(mBase+inPos*s, mBase + (inPos+inLen)*s, (length-(inPos+inLen))*s); |
| 383 | resize(length-inLen); |
| 384 | } |
| 385 | |
| 386 | void ArrayBase::Slice(ArrayBase *outResult,int inPos,int inEnd) |
| 387 | { |
nothing calls this directly
no test coverage detected