Skip to content

Commit

Permalink
task05: use is_empty() instead of extract_unused()
Browse files Browse the repository at this point in the history
  • Loading branch information
miri64 committed Nov 10, 2018
1 parent 1f5c18d commit 9422129
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions 05-single-hop-route/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ def single_hop_run(source, dest, ip_src, ip_dest,
source.reboot()
dest.reboot()

buf_source_start = source.extract_unused()
buf_dest_start = dest.extract_unused()

# Get useful information
iface = source.get_first_iface()
ip_src_ll = dest.get_ip_addr()
Expand All @@ -59,8 +56,5 @@ def single_hop_run(source, dest, ip_src, ip_dest,

packet_loss = source.ping(
count, ip_dest.split("/")[0], PAYLOAD_SIZE, DELAY)
buf_source_end = source.extract_unused()
buf_dest_end = dest.extract_unused()

return (packet_loss, buf_source_end == buf_source_start,
buf_dest_end == buf_dest_start)
return (packet_loss, source.is_empty(), dest.is_empty())

0 comments on commit 9422129

Please sign in to comment.