Skip to content

Commit

Permalink
Fixed important logic error in fetch magnet
Browse files Browse the repository at this point in the history
  • Loading branch information
aldenml committed Feb 24, 2016
1 parent 513a1d2 commit dfccbac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/frostwire/jlibtorrent/Session.java
Expand Up @@ -822,7 +822,7 @@ public byte[] fetchMagnet(String uri, int timeout) {

data = MAGNET_CACHE.get(sha1);
if (data != null) {
return data;
break; // aldenml: this in one of those cases in which "break" is more clear to me

This comment has been minimized.

Copy link
@gubatron

gubatron Feb 24, 2016

Collaborator

or perhaps an } while (data != null || n < timeout) would be better.

This comment has been minimized.

Copy link
@aldenml

aldenml Feb 24, 2016

Author Collaborator

True, the need of comment was a strong suggestion that something was not right

This comment has been minimized.

Copy link
@gubatron

gubatron Feb 24, 2016

Collaborator

so the bug was that it wasn't doing the logic on removing the torrent below?

This comment has been minimized.

Copy link
@aldenml

aldenml Feb 24, 2016

Author Collaborator

exactly

This comment has been minimized.

Copy link
@aldenml

aldenml Feb 24, 2016

Author Collaborator

it's more like data == null

This comment has been minimized.

Copy link
@gubatron

gubatron Feb 24, 2016

Collaborator

true, boolean master in effect over here.

}

n++;
Expand All @@ -834,7 +834,7 @@ public byte[] fetchMagnet(String uri, int timeout) {
}
}

return null;
return data;
}

@Override
Expand Down

0 comments on commit dfccbac

Please sign in to comment.