Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
htop
Commits
f37a050d
Commit
f37a050d
authored
Feb 05, 2018
by
Hisham Muhammad
Browse files
Optimize Vector_size on non-debug builds
parent
03f17688
Changes
2
Hide whitespace changes
Inline
Side-by-side
Vector.c
View file @
f37a050d
...
...
@@ -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) {
...
...
Vector.h
View file @
f37a050d
...
...
@@ -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
/*
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment