Skip to content

Commit

Permalink
Use unicode() instead of decode() for perfs
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoCavaille committed Jan 15, 2015
1 parent 3014830 commit a7ab7fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,8 @@ def submit_packets(self, packets):
# network socket, but if submit_packets is used
# programatically and packets is unicode already
# then do not decode!
if not isinstance(packets, unicode):
packets = packets.decode('utf-8', 'replace')
if not type(packets) == unicode:
packets = unicode(packets, 'utf-8')

for packet in packets.splitlines():

Expand Down

0 comments on commit a7ab7fc

Please sign in to comment.