Skip to content

Commit c5fe516

Browse files
committed
miniscript: nit: don't return after assert(false)
1 parent 7bbaca9 commit c5fe516

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

src/script/miniscript.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ Type ComputeType(Fragment fragment, Type x, Type y, Type z, const std::vector<Ty
245245
}
246246
}
247247
assert(false);
248-
return ""_mst;
249248
}
250249

251250
size_t ComputeScriptLen(Fragment fragment, Type sub0typ, size_t subsize, uint32_t k, size_t n_subs, size_t n_keys) {
@@ -278,7 +277,6 @@ size_t ComputeScriptLen(Fragment fragment, Type sub0typ, size_t subsize, uint32_
278277
case Fragment::THRESH: return subsize + n_subs + BuildScript(k).size();
279278
}
280279
assert(false);
281-
return 0;
282280
}
283281

284282
std::optional<std::vector<Opcode>> DecomposeScript(const CScript& script)

src/script/miniscript.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,6 @@ struct Node {
532532
}
533533
}
534534
assert(false);
535-
return {};
536535
};
537536
return TreeEval<CScript>(false, downfn, upfn);
538537
}
@@ -632,9 +631,9 @@ struct Node {
632631
}
633632
return std::move(str) + ")";
634633
}
635-
default: assert(false);
634+
default: break;
636635
}
637-
return ""; // Should never be reached.
636+
assert(false);
638637
};
639638

640639
return TreeEvalMaybe<std::string>(false, downfn, upfn);
@@ -711,7 +710,6 @@ struct Node {
711710
}
712711
}
713712
assert(false);
714-
return {0, {}, {}};
715713
}
716714

717715
internal::StackSize CalcStackSize() const {
@@ -762,7 +760,6 @@ struct Node {
762760
}
763761
}
764762
assert(false);
765-
return {{}, {}};
766763
}
767764

768765
/** Check whether any key is repeated.

0 commit comments

Comments
 (0)