Skip to content

Commit

Permalink
Sleeker indexOf evaluation. Minor.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed Mar 30, 2011
1 parent 14ee5c7 commit 9e14b46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modernizr.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ window.Modernizr = (function(window,document,undefined){
* contains returns a boolean for if substr is found within str.
*/
function contains( str, substr ) {
return (''+str).indexOf( substr ) !== -1;
return ~(''+str).indexOf( substr );
}

/**
Expand Down

3 comments on commit 9e14b46

@ralphholzmann
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@paulirish
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BEE TEE DUBS: this technique originated by ralph holzmannnnnn

@SlexAxton
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so sexy.

Please sign in to comment.