-/* $Id$ */
-
/* a generic and efficient heap */
-/* Copyright (c) 2004 Arnaud Legrand. All rights reserved. */
+/* Copyright (c) 2004, 2005, 2007, 2008, 2009, 2010. The SimGrid Team.
+ * All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
(void *) realloc(H->items, (H->size) * sizeof(struct xbt_heapItem));
}
- H->update_callback ? H->update_callback(max, -1) : NULL;
+ if(H->update_callback) H->update_callback(max, -1);
return max;
}
struct xbt_heapItem tmp = H->items[i];
H->items[i] = H->items[greatest];
H->items[greatest] = tmp;
- H->update_callback ? H->update_callback(CONTENT(H, i), i) : NULL;
+ if(H->update_callback) H->update_callback(CONTENT(H, i), i);
i = greatest;
} else {
- H->update_callback ? H->update_callback(CONTENT(H, i), i) : NULL;
+ if(H->update_callback) H->update_callback(CONTENT(H, i), i);
return;
}
}
struct xbt_heapItem tmp = H->items[i];
H->items[i] = H->items[PARENT(i)];
H->items[PARENT(i)] = tmp;
- H->update_callback ? H->update_callback(CONTENT(H, i), i) : NULL;
+ if(H->update_callback) H->update_callback(CONTENT(H, i), i);
i = PARENT(i);
}
- H->update_callback ? H->update_callback(CONTENT(H, i), i) : NULL;
+ if(H->update_callback) H->update_callback(CONTENT(H, i), i);
return;
}