Cleanup format #50

merged 3 commits into from Jul 3, 2012

2 participants


I noticed some redundant boolean logic.

For example:

if xLastType.nil? == true or xLastType != kElement["type"]

You can leave out the == true because everything except nil and false is a truthy value in ruby

Another example for overly complex logic was:

if @node_two_port.nil? or with_port == false

As nil is falsey you are checking:

if @node_two_port == false or with_port == false

Replaced == false with not:

if ( not @node_two_port or not with_port )

Which simplifies to

if not (@node_two_port and with_port )

And I removed the trailing whitespace in ( I guess ) most of the files.

@glejeune glejeune merged commit 179c885 into glejeune:master Jul 3, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment