Skip to content
Snippets Groups Projects
Commit d05cf6fa authored by Iustin Pop's avatar Iustin Pop
Browse files

utils._RunCmdPipe: simplify the timeout logic


There are two issues: first, it's simpler to assign directly to pt
instead of via another local variable. Second, this code doesn't make
sense:
  if lt < 0:
    break
  pt = max(0, lt)

If lt is indeed < 0, then the code will break. Otherwise, lt ≥ 0, and
max(0, lt) will always be equal to lt. So we remove the extra
assignment.

Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
parent a298fd5a
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment