You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
int fastParseOn(String buffer, int position) {
final result = parseOn(Context(buffer, position));
return switch (result) {
Success(position: final position) => position,
Failure() => -1
};
}
I wonder if this might have been fast enough to still use the switch:
int fastParseOn(String buffer, int position) {
final result = parseOn(Context(buffer, position));
return switch (result) {
final Success s => s.position,
Failure _ => -1,
};
}
I understand that might work faster for sorting out types and mapping them to branches. I think Type() goes through a lot of extra work compared to Type _.