Skip to content

Commit

Permalink
Doc edits
Browse files Browse the repository at this point in the history
  • Loading branch information
mikera committed Jul 19, 2023
1 parent f7695f8 commit a10254b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions convex-core/src/main/java/convex/core/data/Format.java
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,11 @@ public static String encodedString(Object o) {
return encodedString(RT.cvm(o));
}

/**
* Estimate the encoding size of a Cell value. Useful for pre-sizing buffers.
* @param cell Cell to estimate encoding size for
* @return Estimated encoding size. May not be precise.
*/
public static int estimateEncodingSize(ACell cell) {
if (cell==null) return 1;
return cell.estimatedEncodingSize();
Expand Down

0 comments on commit a10254b

Please sign in to comment.