mirror of
https://github.com/flarum/core.git
synced 2025-08-06 08:27:42 +02:00
Use some
for needsRebuild in SubtreeRetainer
This commit is contained in:
committed by
Franz Liedke
parent
c8d5ca51bb
commit
07f04c7ba7
@@ -33,18 +33,16 @@ export default class SubtreeRetainer {
|
|||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
needsRebuild() {
|
needsRebuild() {
|
||||||
let needsRebuild = false;
|
return this.callbacks.some((callback, i) => {
|
||||||
|
|
||||||
this.callbacks.forEach((callback, i) => {
|
|
||||||
const result = callback();
|
const result = callback();
|
||||||
|
|
||||||
if (result !== this.data[i]) {
|
if (result !== this.data[i]) {
|
||||||
this.data[i] = result;
|
this.data[i] = result;
|
||||||
needsRebuild = true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
return needsRebuild;
|
return false;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user