From 42d009350381de69b79dd76f96803306214c8afc Mon Sep 17 00:00:00 2001 From: kanoi Date: Sat, 31 Oct 2015 23:01:03 +1100 Subject: [PATCH] ckdb - use new workinfo diff_target rather than recalc it --- src/ckdb.h | 2 +- src/ckdb_dbio.c | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/ckdb.h b/src/ckdb.h index bc14329a..313635d7 100644 --- a/src/ckdb.h +++ b/src/ckdb.h @@ -55,7 +55,7 @@ #define DB_VLOCK "1" #define DB_VERSION "1.0.4" -#define CKDB_VERSION DB_VERSION"-1.502" +#define CKDB_VERSION DB_VERSION"-1.503" #define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL_HERE __FILE__, __func__, __LINE__ diff --git a/src/ckdb_dbio.c b/src/ckdb_dbio.c index eed9f5cf..d60fa1f1 100644 --- a/src/ckdb_dbio.c +++ b/src/ckdb_dbio.c @@ -5019,15 +5019,12 @@ flail: blk = true; w_item = find_workinfo(row->workinfoid, NULL); if (w_item) { - char wdiffbin[TXT_SML+1]; - double wdiff; WORKINFO *workinfo; DATA_WORKINFO(workinfo, w_item); - hex2bin(wdiffbin, workinfo->bits, 4); - wdiff = diff_from_nbits(wdiffbin); - if (wdiff > 0.0) { + if (workinfo->diff_target > 0.0) { snprintf(pct, sizeof(pct), "%.2f", - 100.0 * pool.diffacc / wdiff); + 100.0 * pool.diffacc / + workinfo->diff_target); } } if (pool.diffacc >= 1000.0) {