netsampler / goflow2

High performance sFlow/IPFIX/NetFlow Collector
BSD 3-Clause "New" or "Revised" License
487 stars 112 forks source link

fix(renderer): optimize function ProtoName #343

Closed lspgn closed 3 months ago

lspgn commented 3 months ago

Following #341: Small optimization: avoids going through the condition first, start with protocol lookup. Combine the if/else

cc @marioschaefer / @DerInti

marioschaefer commented 3 months ago

makes sense