the docs were wrong
This commit is contained in:
@@ -908,10 +908,10 @@ nn_Exit nn_dumptable(nn_Computer *computer, size_t idx, size_t *len);
|
||||
// computes the cost of the top [values] values using the same algorithm as
|
||||
// the modem.
|
||||
// It will return -1 if the values are invalid.
|
||||
// The algorithm is as mentioned in https://ocdoc.cil.li/component:modem
|
||||
// The algorithm is as mentioned in https://ocdoc.cil.li/component:modem, with 1 small change to match OC's code.
|
||||
// and is as follows:
|
||||
// - Every value adds a 2 byte overhead
|
||||
// - Numbers add another 8 bytes, true/false/null another 4 bytes, strings as
|
||||
// - Numbers add another 8 bytes, true/false/null another 1 byte, strings as
|
||||
// many bytes as they contain, except empty strings count as 1 byte.
|
||||
int nn_countValueCost(nn_Computer *computer, size_t values);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user