Use for-of instead of forEach (#3583)

Co-authored-by: syuilo <syuilotan@yahoo.co.jp>
Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
This commit is contained in:
Aya Morisawa 2018-12-11 20:36:55 +09:00 committed by GitHub
parent 30c53e9ee0
commit 125849673a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
84 changed files with 345 additions and 283 deletions

View file

@ -136,9 +136,9 @@ export default (os: MiOS) => new Vuex.Store({
},
mergeMe(ctx, me) {
Object.entries(me).forEach(([key, value]) => {
for (const [key, value] of Object.entries(me)) {
ctx.commit('updateIKeyValue', { key, value });
});
}
if (me.clientSettings) {
ctx.dispatch('settings/merge', me.clientSettings);
@ -215,11 +215,11 @@ export default (os: MiOS) => new Vuex.Store({
//#region Deck
if (state.deck && state.deck.columns) {
state.deck.columns.filter(c => c.type == 'widgets').forEach(c => {
c.widgets.forEach(w => {
if (w.id == x.id) w.data = x.data;
});
});
for (const c of state.deck.columns.filter(c => c.type == 'widgets')) {
for (const w of c.widgets.filter(w => w.id == x.id)) {
w.data = x.data;
}
}
}
//#endregion
},
@ -345,9 +345,9 @@ export default (os: MiOS) => new Vuex.Store({
actions: {
merge(ctx, settings) {
if (settings == null) return;
Object.entries(settings).forEach(([key, value]) => {
for (const [key, value] of Object.entries(settings)) {
ctx.commit('set', { key, value });
});
}
},
set(ctx, x) {