Return early
This commit is contained in:
parent
005dfa24cd
commit
ee019114cc
1 changed files with 5 additions and 1 deletions
6
index.js
6
index.js
|
|
@ -152,7 +152,11 @@ function applyStyle() {
|
|||
// Support varags, but simply cast to string in case there's only one arg
|
||||
const args = arguments;
|
||||
const argsLen = args.length;
|
||||
let str = argsLen === 0 ? '' : String(arguments[0]);
|
||||
let str = argsLen !== 0 && String(arguments[0]);
|
||||
|
||||
if (argsLen === 0) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (argsLen > 1) {
|
||||
// Don't slice `arguments`, it prevents V8 optimizations
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue