1
0
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:
Alexander Skvortsov
2020-09-04 17:43:57 -04:00
committed by Franz Liedke
parent c8d5ca51bb
commit 07f04c7ba7

View File

@@ -33,18 +33,16 @@ export default class SubtreeRetainer {
* @public
*/
needsRebuild() {
let needsRebuild = false;
this.callbacks.forEach((callback, i) => {
return this.callbacks.some((callback, i) => {
const result = callback();
if (result !== this.data[i]) {
this.data[i] = result;
needsRebuild = true;
return true;
}
});
return needsRebuild;
return false;
});
}
/**