This is an automated email from the ASF dual-hosted git repository.

nickva pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb-jiffy.git

commit b2c4ae23a9e8f936fde471bd99baa0e8704d83f3
Author: Nick Vatamaniuc <[email protected]>
AuthorDate: Wed Apr 1 15:08:05 2026 -0400

    Use assert for dec_number unreacheable state
    
    Hat tip to davisp for noticing this is unreacheable and for the nice tip on 
how
    to make lcov ignore it.
---
 c_src/decoder.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/c_src/decoder.c b/c_src/decoder.c
index 1f67b41..2a9267b 100644
--- a/c_src/decoder.c
+++ b/c_src/decoder.c
@@ -395,7 +395,6 @@ dec_number(Decoder* d, ERL_NIF_TERM* value)
     const size_t len = d->len;
     const size_t start = d->i;
     size_t idx = start;
-
     while(idx < len) {
         switch(state) {
             case nst_init:
@@ -421,8 +420,7 @@ dec_number(Decoder* d, ERL_NIF_TERM* value)
                         idx++;
                         break;
                     default:
-                        d->i = idx;
-                        return 0;
+                        assert(0 && "this state should be unreachable"); // 
LCOV_EXCL_LINE
                 }
                 break;
 

Reply via email to