svn commit: r272315 - head/tools/sched

John Baldwin jhb at FreeBSD.org
Tue Sep 30 17:19:08 UTC 2014


Author: jhb
Date: Tue Sep 30 17:19:07 2014
New Revision: 272315
URL: http://svnweb.freebsd.org/changeset/base/272315

Log:
  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.

Modified:
  head/tools/sched/schedgraph.py

Modified: head/tools/sched/schedgraph.py
==============================================================================
--- head/tools/sched/schedgraph.py	Tue Sep 30 17:14:11 2014	(r272314)
+++ head/tools/sched/schedgraph.py	Tue Sep 30 17:19:07 2014	(r272315)
@@ -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)


More information about the svn-src-head mailing list