Skip to content

Commit

Permalink
Invert the logic so that it can be true sometimes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hashwords committed Dec 19, 2016
1 parent 4bf9abd commit 98138ee
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions java/org/hashwords/pledge/Pledge.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private final static String generatePromises()
*/
public final static boolean addPromise(String... promises)
{
boolean added = false ;
boolean added = true;

if(promises != null)
{
Expand All @@ -155,8 +155,16 @@ public final static boolean addPromise(String... promises)
}
}
}
else
{
added = false;
}
}
}
else
{
added = false;
}

return added;
}
Expand Down Expand Up @@ -198,7 +206,7 @@ private final static boolean arrayContains(Object candidate ,
*/
public final static boolean removePromise(String... promises)
{
boolean removed = false;
boolean removed = true;

if(promises != null)
{
Expand All @@ -212,8 +220,16 @@ public final static boolean removePromise(String... promises)
for(String subpromise : subpromises)
removed &= PROMISES.remove(subpromise);
}
else
{
removed = false;
}
}
}
else
{
removed = false;
}

return removed;
}
Expand Down

0 comments on commit 98138ee

Please sign in to comment.