Skip to content

Commit

Permalink
Fix logic for determining whether user is getting on or off transit. #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Conway committed Aug 15, 2012
1 parent 9464394 commit ea36e3f
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,10 @@ public State traverse(State state0, long arrivalTimeAtStop) {
TraverseMode mode = state0.getNonTransitMode(options);

// figure out the direction
// XOR: http://stackoverflow.com/questions/726652
boolean offTransit = !((boarding || options.isArriveBy()) &&
!(boarding && options.isArriveBy()));
// it's leaving transit iff it's a boarding and is arrive by, or it's not a boarding and
// is not arrive by
boolean offTransit = (boarding && options.isArriveBy()) ||
(!boarding && !options.isArriveBy());

if (offTransit) {
int type;
Expand Down

0 comments on commit ea36e3f

Please sign in to comment.