diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2018-02-05 11:01:35 +0100 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-02-05 11:01:35 +0100 |
commit | f37a050d3d0c6928b09d9b19e1283a695c52ccc7 (patch) | |
tree | 5eb816b52f4de1f6ac4e5e7c2b55dc056bb639a7 | |
parent | 03f17688ada3800bdd344ec4397f81289977b153 (diff) | |
download | android_external_htop-f37a050d3d0c6928b09d9b19e1283a695c52ccc7.tar.gz android_external_htop-f37a050d3d0c6928b09d9b19e1283a695c52ccc7.tar.bz2 android_external_htop-f37a050d3d0c6928b09d9b19e1283a695c52ccc7.zip |
Optimize Vector_size on non-debug builds
-rw-r--r-- | Vector.c | 8 | ||||
-rw-r--r-- | Vector.h | 8 |
2 files changed, 16 insertions, 0 deletions
@@ -284,11 +284,19 @@ inline Object* Vector_get(Vector* this, int idx) { #endif +#ifdef DEBUG + inline int Vector_size(Vector* this) { assert(Vector_isConsistent(this)); return this->items; } +#else + +#define Vector_size(v_) ((v_)->items) + +#endif + /* static void Vector_merge(Vector* this, Vector* v2) { @@ -70,8 +70,16 @@ extern Object* Vector_get(Vector* this, int idx); #endif +#ifdef DEBUG + extern int Vector_size(Vector* this); +#else + +#define Vector_size(v_) ((v_)->items) + +#endif + /* */ |