projects
/
psensor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e43318f
)
optim, break the loop as the measures are sorted.
author
Jean-Philippe Orsini
<jeanfi@gmail.com>
Sun, 14 Sep 2014 15:43:26 +0000
(17:43 +0200)
committer
Jean-Philippe Orsini
<jeanfi@gmail.com>
Sun, 14 Sep 2014 15:43:26 +0000
(17:43 +0200)
src/graph.c
patch
|
blob
|
history
diff --git
a/src/graph.c
b/src/graph.c
index
b2b17cb
..
792bb25
100644
(file)
--- a/
src/graph.c
+++ b/
src/graph.c
@@
-61,6
+61,8
@@
struct graph_info {
/* Return the end time of the graph i.e. the more recent measure. If
* no measure are available, return 0.
+ * If Bezier curves are used return the measure n-3 to avoid to
+ * display a part of the curve outside the graph area.
*/
static time_t get_graph_end_time_s(struct psensor **sensors)
{
@@
-84,8
+86,10
@@
static time_t get_graph_end_time_s(struct psensor **sensors)
if (!n) {
t = measures[i].time.tv_sec;
- if (t > ret)
+ if (t > ret)
{
ret = t;
+ break;
+ }
} else {
n--;
}