Skip to content

Commit

Permalink
feat: update
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuever committed Sep 16, 2023
1 parent dba0170 commit 3a91e98
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
23 changes: 12 additions & 11 deletions packages/data-model/src/FixedBuffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,18 @@ class FixedBuffer {
const position = idx;
this._newItemMetaIndices[position] = itemMeta;
this._indices[position] = index;
} else {
const position = this.getPosition(
index,
safeRange.startIndex,
safeRange.endIndex
);
if (position === position) {
this._newItemMetaIndices[position] = itemMeta;
}
return position
}
const position = this.getPosition(
index,
safeRange.startIndex,
safeRange.endIndex
);
if (position === position) {
this._indices[position] = index;
this._newItemMetaIndices[position] = itemMeta;
}
return position
}

getMaxValue() {
Expand All @@ -138,8 +140,7 @@ class FixedBuffer {
const arr = [];
const nextItemMetaIndices = new Array(this._recyclerReservedBufferSize);
for (let idx = 0; idx < this._recyclerReservedBufferSize; idx++) {
if (typeof this._newItemMetaIndices[idx] === 'number') {
// const targetIndex = this._bufferSet.indices[idx]
if (this._newItemMetaIndices[idx]) {
const targetIndex = this._indices[idx];
const itemMeta = this._newItemMetaIndices[idx];
arr.push({
Expand Down
9 changes: 8 additions & 1 deletion packages/data-model/src/ListBaseDimensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,8 @@ class ListBaseDimensions<ItemT extends {} = {}> {
{
recycleState,
spaceState,
// @ts-ignore
rangeState: stateResult.rangeState,
},
this._stateResult
);
Expand All @@ -588,7 +590,11 @@ class ListBaseDimensions<ItemT extends {} = {}> {
}
}

this._stateResult = stateResult;
this._stateResult = {
...stateResult,
// @ts-ignore
rangeState: stateResult.rangeState,
};
}

setState(state: ListState<ItemT>, force = false) {
Expand Down Expand Up @@ -778,6 +784,7 @@ class ListBaseDimensions<ItemT extends {} = {}> {
const stateResult = {
recycleState: recycleStateResult.filter((v) => v),
spaceState: spaceStateResult.filter((v) => v),
rangeState: state,
};

return stateResult;
Expand Down
1 change: 0 additions & 1 deletion packages/data-model/src/ListGroupDimensions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Batchinator from '@x-oasis/batchinator';
import isClamped from '@x-oasis/is-clamped';
import noop from '@x-oasis/noop';
import shallowArrayEqual from '@x-oasis/shallow-array-equal';
import resolveChanged from '@x-oasis/resolve-changed';
import defaultBooleanValue from '@x-oasis/default-boolean-value';
import PrefixIntervalTree from '@x-oasis/prefix-interval-tree';
Expand Down

0 comments on commit 3a91e98

Please sign in to comment.