Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Sep 2014 17:19:07 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r272315 - head/tools/sched
Message-ID:  <201409301719.s8UHJ7cw007935@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409301719.s8UHJ7cw007935>