Skip to content

Commit

Permalink
remove superfluous haveStat flag
Browse files Browse the repository at this point in the history
  • Loading branch information
lehenbauer committed Jan 13, 2017
1 parent 2f17f4d commit 56af209
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
12 changes: 3 additions & 9 deletions generic/zookeepertcl.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,10 +487,7 @@ zootcl_sync_stat_completion_callback (int rc, const struct Stat *stat, const voi
{
zootcl_syncCallbackContext *zsc = (zootcl_syncCallbackContext *)context;
zsc->rc = rc;
if (stat == NULL) {
zsc->haveStat = 0;
} else {
zsc->haveStat = 1;
if (stat != NULL) {
zsc->stat = *stat;
}
zsc->syncDone = 1;
Expand Down Expand Up @@ -522,10 +519,7 @@ zootcl_sync_data_completion_callback (int rc, const char *value, int valueLen, c
}

// structure copy status structure only if it exists
if (stat == NULL) {
zsc->haveStat = 0;
} else {
zsc->haveStat = 1;
if (stat != NULL) {
zsc->stat = *stat;
}

Expand Down Expand Up @@ -1447,7 +1441,7 @@ zootcl_get_subcommand(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], ZOOAP
Tcl_SetObjResult (interp, Tcl_NewBooleanObj (1));
}

if (zsc->haveStat && zootcl_stat_to_array (interp, statArray, &zsc->stat) == TCL_ERROR) {
if (zootcl_stat_to_array (interp, statArray, &zsc->stat) == TCL_ERROR) {
return TCL_ERROR;
}

Expand Down
1 change: 0 additions & 1 deletion generic/zookeepertcl.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ typedef struct zootcl_syncCallbackContext
{
zootcl_objectClientData *zo;
int rc;
int haveStat;
struct Stat stat;
int syncDone;
Tcl_Obj *dataObj;
Expand Down

0 comments on commit 56af209

Please sign in to comment.