ericadamski / collaborative-edit

A collaboration package for the Atom Text Editor ( REMOVED FROM ATOM, for now, due to many errors )
MIT License
2 stars 1 forks source link

Use operators provided by CoffeeScript #7

Closed Sieniawsky closed 9 years ago

Sieniawsky commented 9 years ago

Verbose existence checks are not needed since CoffeeScript provides the ? operator.

For instance, reference this code.

return op[0].d if op[0].d isnt undefined

can be simplified as:

return op[0].d if op[0].d?

or further simplified:

return op[0].d? or 0 where 0 could be some default

ericadamski commented 9 years ago

I used this where I could, in some places it gave me unwanted results.