perf: reorder checks to maximize short-circuiting speed

Co-authored-by: Joonas Koivunen <joonas.koivunen@gmail.com>
This commit is contained in:
ljedrz 2020-08-20 10:12:00 +02:00 committed by GitHub
parent 61b8b6ff1e
commit 4f2ffe702e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -405,7 +405,7 @@ fn handle_dagpb_not_found(
) -> Result<(Cid, Loaded, Vec<String>), WalkError> {
use ipfs::unixfs::ll::dagpb::node_data;
if needle == "Data" && last_segment && opts.follow_dagpb_data {
if opts.follow_dagpb_data && last_segment && needle == "Data" {
// /dag/resolve needs to "resolve through" a dag-pb node down to the "just data" even
// though we do not need to extract it ... however this might be good to just filter with
// refs, as no refs of such path can exist as the links are in the outer structure.