Skip to content

Commit 991ea6c

Browse files
committed
refactored local variables
1 parent 5339a52 commit 991ea6c

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

lib/src/box.dart

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -167,44 +167,44 @@ class Box<T> {
167167
QueryBuilder query(Condition qc) => QueryBuilder<T>(_store, _fbManager, _modelEntity.id.id, qc);
168168

169169
int count({int limit = 0}) {
170-
Pointer<Uint64> _count = Pointer<Uint64>.allocate();
170+
Pointer<Uint64> count = Pointer<Uint64>.allocate();
171171
try {
172-
checkObx(bindings.obx_box_count(_cBox, limit, _count));
173-
return _count.load<int>();
172+
checkObx(bindings.obx_box_count(_cBox, limit, count));
173+
return count.load<int>();
174174
} finally {
175-
_count.free();
175+
count.free();
176176
}
177177
}
178178

179179
bool isEmpty() {
180-
Pointer<Uint8> _isEmpty = Pointer<Uint8>.allocate();
180+
Pointer<Uint8> isEmpty = Pointer<Uint8>.allocate();
181181
try {
182-
checkObx(bindings.obx_box_is_empty(_cBox, _isEmpty));
183-
return _isEmpty.load<int>() > 0 ? true : false;
182+
checkObx(bindings.obx_box_is_empty(_cBox, isEmpty));
183+
return isEmpty.load<int>() > 0 ? true : false;
184184
} finally {
185-
_isEmpty.free();
185+
isEmpty.free();
186186
}
187187
}
188188

189189
bool contains(int id) {
190-
Pointer<Uint8> _contains = Pointer<Uint8>.allocate();
190+
Pointer<Uint8> contains = Pointer<Uint8>.allocate();
191191
try {
192-
checkObx(bindings.obx_box_contains(_cBox, id, _contains));
193-
return _contains.load<int>() > 0 ? true : false;
192+
checkObx(bindings.obx_box_contains(_cBox, id, contains));
193+
return contains.load<int>() > 0 ? true : false;
194194
} finally {
195-
_contains.free();
195+
contains.free();
196196
}
197197
}
198198

199199
bool containsMany(List<int> ids) {
200-
Pointer<Uint8> _contains = Pointer<Uint8>.allocate();
200+
Pointer<Uint8> contains = Pointer<Uint8>.allocate();
201201
try {
202202
return OBX_id_array.executeWith(ids, (ptr) {
203-
checkObx(bindings.obx_box_contains_many(_cBox, ptr, _contains));
204-
return _contains.load<int>() > 0 ? true : false;
203+
checkObx(bindings.obx_box_contains_many(_cBox, ptr, contains));
204+
return contains.load<int>() > 0 ? true : false;
205205
});
206206
} finally {
207-
_contains.free();
207+
contains.free();
208208
}
209209
}
210210

@@ -221,24 +221,24 @@ class Box<T> {
221221
}
222222

223223
int removeMany(List<int> ids) {
224-
Pointer<Uint64> _removedIds = Pointer<Uint64>.allocate();
224+
Pointer<Uint64> removedIds = Pointer<Uint64>.allocate();
225225
try {
226226
return OBX_id_array.executeWith(ids, (ptr) {
227-
checkObx(bindings.obx_box_remove_many(_cBox, ptr, _removedIds));
228-
return _removedIds.load<int>();
227+
checkObx(bindings.obx_box_remove_many(_cBox, ptr, removedIds));
228+
return removedIds.load<int>();
229229
});
230230
} finally {
231-
_removedIds.free();
231+
removedIds.free();
232232
}
233233
}
234234

235235
int removeAll() {
236-
Pointer<Uint64> _removedItems = Pointer<Uint64>.allocate();
236+
Pointer<Uint64> removedIds = Pointer<Uint64>.allocate();
237237
try {
238-
checkObx(bindings.obx_box_remove_all(_cBox, _removedItems));
239-
return _removedItems.load<int>();
238+
checkObx(bindings.obx_box_remove_all(_cBox, removedIds));
239+
return removedIds.load<int>();
240240
} finally {
241-
_removedItems.free();
241+
removedIds.free();
242242
}
243243
}
244244

0 commit comments

Comments
 (0)