Permalink
Browse files

Small fixes

  • Loading branch information...
theirix committed Oct 4, 2012
1 parent d17352c commit 7ebe794fd50b2a8dc4a3cf81f05445aebd2d8ba6
Showing with 2 additions and 8 deletions.
  1. +1 −2 Makefile
  2. +1 −6 src/json_accessors.c
View
@@ -1,6 +1,5 @@
EXTENSION = json_accessors
-EXTVERSION = $(shell grep default_version $(EXTENSION).control | \
- sed -e "s/default_version[[:space:]]*=[[:space:]]*'\([^']*\)'/\1/")
+EXTVERSION = 1.3.2
MODULE_big = json_accessors
OBJS = $(patsubst %.c,%.o,$(wildcard src/*.c))
DATA = $(wildcard sql/*--*.sql) sql/$(EXTENSION)--$(EXTVERSION).sql
View
@@ -189,7 +189,6 @@ ArrayType* construct_typed_array(Datum *elems, int nelems, Oid elmtype)
*/
Datum json_object_get_generic(text *argJson, text *argKey, int json_type, pextract_type_from_json extractor)
{
- bool status = false;
Datum result;
char *strJson, *strKey;
cJSON *root, *sel;
@@ -205,11 +204,7 @@ Datum json_object_get_generic(text *argJson, text *argKey, int json_type, pextra
{
if (json_type == CJSON_TYPE_ANY || match_json_types(json_type, sel->type))
{
- if (extractor(sel, &result))
- {
- status = true;
- }
- else
+ if (!extractor(sel, &result))
{
ereport(ERROR,
(errcode(ERRCODE_WRONG_OBJECT_TYPE),

0 comments on commit 7ebe794

Please sign in to comment.