1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-09-29 21:49:07 +00:00

branch conditionally

In case of undefined MATH there were empty branches which could lead to
decreased performance in totally unoptimised code. ;)
This commit is contained in:
Phil Sutter 2009-06-04 22:00:52 +02:00
parent 8407d6b3c9
commit 9d7fc86275

View File

@ -271,11 +271,11 @@ static void graph_append(struct special_t *graph, double f, char showaslog)
{
int i;
if (showaslog) {
#ifdef MATH
if (showaslog) {
f = log10(f + 1);
#endif
}
#endif
if (!graph->scaled && f > graph->graph_scale) {
f = graph->graph_scale;
@ -334,11 +334,11 @@ void new_graph(char *buf, int w, int h, unsigned int first_colour,
/* if (s->width) {
s->graph_width = s->width - 2; // subtract 2 for rectangle around
} */
if (showaslog) {
#ifdef MATH
if (showaslog) {
s->graph_scale = log10(s->graph_scale + 1);
#endif
}
#endif
if (append) {
graph_append(s, i, showaslog);
}