diff options
author | jhb <jhb@FreeBSD.org> | 2014-09-30 17:19:07 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2014-09-30 17:19:07 +0000 |
commit | 0410aaa991e3fae5b3d7d444283a73ba77a53fdf (patch) | |
tree | de50215e7f52a76b36e69320ac311d9c6833e8bc | |
parent | 3083772f7f1859248cdadd3ca0cf89b7a7a3ed37 (diff) | |
download | FreeBSD-src-0410aaa991e3fae5b3d7d444283a73ba77a53fdf.zip FreeBSD-src-0410aaa991e3fae5b3d7d444283a73ba77a53fdf.tar.gz |
Explicitly return None for negative event indices. Prior to this,
eventat(-1) would return the next-to-last event causing the back button
to cycle back to the end of an event source instead of stopping at the
start.
-rw-r--r-- | tools/sched/schedgraph.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/sched/schedgraph.py b/tools/sched/schedgraph.py index 4335574..e592514 100644 --- a/tools/sched/schedgraph.py +++ b/tools/sched/schedgraph.py @@ -856,7 +856,7 @@ class EventSource: return (Y_EVENTSOURCE) def eventat(self, i): - if (i >= len(self.events)): + if (i >= len(self.events) or i < 0): return (None) event = self.events[i] return (event) |