Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve use of buildClassName fn #1404

Merged
merged 1 commit into from
Dec 14, 2016
Merged

Improve use of buildClassName fn #1404

merged 1 commit into from
Dec 14, 2016

Conversation

Yeti-or
Copy link
Member

@Yeti-or Yeti-or commented Aug 31, 2016

Just a little improvement.
buildClassName has a lot of checks before it finally gets to case with only block variable.
It seems that we can omit buildClassName for such cases.

    buildClassName : function(block, elem, modName, modVal) {
        if(isSimple(modName)) {
            if(!isSimple(modVal)) {
                modVal = modName;
                modName = elem;
                elem = undef;
            }
        } else if(typeof modName !== 'undefined') {
            modName = undef;
        } else if(elem && typeof elem !== 'string') {
            elem = undef;
        }

        if(!(elem || modName)) { // optimization for simple case
            return block;
        }
        ...

@coveralls
Copy link

Coverage Status

Coverage remained the same at 62.461% when pulling 5e00072 on yeti-or.imprv-findEnt into 5ee9475 on v4.

@tadatuta tadatuta added this to the 4.0 milestone Sep 6, 2016
@narqo narqo removed this from the 4.0 milestone Sep 16, 2016
@Yeti-or
Copy link
Member Author

Yeti-or commented Dec 14, 2016

@tadatuta you don't like such change?

@tadatuta tadatuta merged commit 47bf165 into v4 Dec 14, 2016
@tadatuta tadatuta deleted the yeti-or.imprv-findEnt branch December 14, 2016 10:01
@tadatuta tadatuta removed the ready label Dec 14, 2016
@tadatuta
Copy link
Member

@Yeti-or thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants