mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-25 07:19:28 -05:00
Explicit std::function nullptr checks.
Eliminates std::function check which tries to "_ZSt25__throw_bad_function_callv", along with 816 bytes of extra code, including some locale/wlocale/moneypunct nonsense.
This commit is contained in:
parent
36c38e4a24
commit
9c11fdf80c
@ -168,7 +168,12 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void symbol_callback(const float symbol, const float lateness) {
|
void symbol_callback(const float symbol, const float lateness) {
|
||||||
|
// NOTE: This check is to avoid std::function nullptr check, which
|
||||||
|
// brings in "_ZSt25__throw_bad_function_callv" and a lot of extra code.
|
||||||
|
// TODO: Make symbol_handler known at compile time.
|
||||||
|
if( symbol_handler) {
|
||||||
symbol_handler(symbol);
|
symbol_handler(symbol);
|
||||||
|
}
|
||||||
|
|
||||||
const float adjustment = error_filter(lateness);
|
const float adjustment = error_filter(lateness);
|
||||||
resampler.advance(adjustment);
|
resampler.advance(adjustment);
|
||||||
|
@ -89,8 +89,13 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( end(bit_history, packet.size()) ) {
|
if( end(bit_history, packet.size()) ) {
|
||||||
|
// NOTE: This check is to avoid std::function nullptr check, which
|
||||||
|
// brings in "_ZSt25__throw_bad_function_callv" and a lot of extra code.
|
||||||
|
// TODO: Make payload_handler known at compile time.
|
||||||
|
if( payload_handler ) {
|
||||||
packet.set_timestamp(Timestamp::now());
|
packet.set_timestamp(Timestamp::now());
|
||||||
payload_handler(packet);
|
payload_handler(packet);
|
||||||
|
}
|
||||||
reset_state();
|
reset_state();
|
||||||
} else {
|
} else {
|
||||||
if( packet_truncated() ) {
|
if( packet_truncated() ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user