Skip to content

Commit 65f16ab

Browse files
committed
refactor: avoid iterator
1 parent 241f91e commit 65f16ab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/app/dataMixin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ export default {
3737
const { locales = {}} = this.$site
3838
let targetLang
3939
let defaultLang
40-
Object.keys(locales).forEach(path => {
40+
for (const path in locales) {
4141
if (path === '/') {
4242
defaultLang = locales[path]
4343
} else if (this.$page.path.indexOf(path) === 0) {
4444
targetLang = locales[path]
4545
}
46-
})
46+
}
4747
return targetLang || defaultLang || {}
4848
},
4949
$title () {

0 commit comments

Comments
 (0)