Skip to content

Commit 1f38eb1

Browse files
committed
prevent string construction
1 parent 067791e commit 1f38eb1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/helpers/helpers.core.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,13 +283,15 @@ export function _deprecated(scope, value, previous, current) {
283283
}
284284
}
285285

286+
const emptyString = '';
287+
const dot = '.';
286288
function indexOfDotOrLength(key, start) {
287-
const idx = key.indexOf('.', start);
289+
const idx = key.indexOf(dot, start);
288290
return idx === -1 ? key.length : idx;
289291
}
290292

291293
export function resolveObjectKey(obj, key) {
292-
if (key === '') {
294+
if (key === emptyString) {
293295
return obj;
294296
}
295297
let pos = 0;

0 commit comments

Comments
 (0)