Merge pull request #301 from haberman/rm-pop

Removed unused push/pop functions.
pull/13171/head
Joshua Haberman 4 years ago committed by GitHub
commit 7f19072206
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      upb/table.c
  2. 9
      upb/table.int.h

@ -559,17 +559,6 @@ bool upb_inttable_remove(upb_inttable *t, uintptr_t key, upb_value *val) {
return success; return success;
} }
bool upb_inttable_push2(upb_inttable *t, upb_value val, upb_alloc *a) {
return upb_inttable_insert2(t, upb_inttable_count(t), val, a);
}
upb_value upb_inttable_pop(upb_inttable *t) {
upb_value val;
bool ok = upb_inttable_remove(t, upb_inttable_count(t) - 1, &val);
UPB_ASSERT(ok);
return val;
}
bool upb_inttable_insertptr2(upb_inttable *t, const void *key, upb_value val, bool upb_inttable_insertptr2(upb_inttable *t, const void *key, upb_value val,
upb_alloc *a) { upb_alloc *a) {
return upb_inttable_insert2(t, (uintptr_t)key, val, a); return upb_inttable_insert2(t, (uintptr_t)key, val, a);

@ -326,15 +326,6 @@ UPB_INLINE bool upb_strtable_remove(upb_strtable *t, const char *key,
* invalidate iterators. */ * invalidate iterators. */
bool upb_inttable_replace(upb_inttable *t, uintptr_t key, upb_value val); bool upb_inttable_replace(upb_inttable *t, uintptr_t key, upb_value val);
/* Handy routines for treating an inttable like a stack. May not be mixed with
* other insert/remove calls. */
bool upb_inttable_push2(upb_inttable *t, upb_value val, upb_alloc *a);
upb_value upb_inttable_pop(upb_inttable *t);
UPB_INLINE bool upb_inttable_push(upb_inttable *t, upb_value val) {
return upb_inttable_push2(t, val, &upb_alloc_global);
}
/* Convenience routines for inttables with pointer keys. */ /* Convenience routines for inttables with pointer keys. */
bool upb_inttable_insertptr2(upb_inttable *t, const void *key, upb_value val, bool upb_inttable_insertptr2(upb_inttable *t, const void *key, upb_value val,
upb_alloc *a); upb_alloc *a);

Loading…
Cancel
Save