Use a VecDequeue instead of a vec for bytes (#2246)
* Fix: add both the rAF queue and vecdequeue * Fix: Take before recycle
This commit is contained in:
1 parent
633e2a70a4
commit
0a3291084f
5 files changed
+26
-9
No files matched your search
@@ -201,8 +201,9 @@ impl<T, S: Storage<T>> GenerationalBox<T, S> {
|
||||
/// Drop the value out of the generational box and invalidate the generational box. This will return the value if the value was taken.
|
||||
pub fn manually_drop(&self) -> Option<T> {
|
||||
if self.validate() {
|
||||
let o = Storage::take(&self.raw.0.data);
|
||||
<S as AnyStorage>::recycle(&self.raw);
|
||||
Storage::take(&self.raw.0.data)
|
||||
o
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user