Browse Source

API: Simplify end-of-device marker

Luke Dashjr 14 years ago
parent
commit
08342856aa
1 changed files with 2 additions and 8 deletions
  1. 2 8
      api.c

+ 2 - 8
api.c

@@ -834,10 +834,7 @@ devdetail_an(char *buf, struct cgpu_info *cgpu, bool isjson)
 		json_decref(info);
 		json_decref(info);
 	}
 	}
 
 
-	if (isjson)
-		tailsprintf(buf, "}");
-	else
-		tailsprintf(buf, "%c", SEPARATOR);
+	tailsprintf(buf, "%c", isjson ? '}' : SEPARATOR);
 }
 }
 
 
 static void devstatus_an(char *buf, struct cgpu_info *cgpu, bool isjson)
 static void devstatus_an(char *buf, struct cgpu_info *cgpu, bool isjson)
@@ -862,10 +859,7 @@ static void devstatus_an(char *buf, struct cgpu_info *cgpu, bool isjson)
 		json_decref(info);
 		json_decref(info);
 	}
 	}
 
 
-	if (isjson)
-		tailsprintf(buf, "}");
-	else
-		tailsprintf(buf, "%c", SEPARATOR);
+	tailsprintf(buf, "%c", isjson ? '}' : SEPARATOR);
 }
 }
 
 
 static void gpustatus(int gpu, bool isjson)
 static void gpustatus(int gpu, bool isjson)