traffic: improve add_short_packet by avoiding dict.get
authorJoe Guo <joeg@catalyst.net.nz>
Thu, 10 May 2018 05:23:02 +0000 (17:23 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 14 May 2018 03:38:06 +0000 (05:38 +0200)
commitd444221d67abc05dc9966dd7e0a37d30f9848953
tree37f0c6fdd6149229732ae18750588fad60512b41
parent21c82072ab87e3dee617b3219364e55e9c106432
traffic: improve add_short_packet by avoiding dict.get

dict.get is slower than [].
Avoid get to improve performance.

(For 3989418 calls, total time decease from 9.395 to 8.573)

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon May 14 05:38:06 CEST 2018 on sn-devel-144
python/samba/emulate/traffic.py