@@ -131,7 +131,8 @@ _PyZstd_load_d_dict(ZstdDecompressor *self, PyObject *dict)
131131    ret  =  PyObject_IsInstance (dict , (PyObject * )mod_state -> ZstdDict_type );
132132    if  (ret  <  0 ) {
133133        return  -1 ;
134-     } else  if  (ret  >  0 ) {
134+     }
135+     else  if  (ret  >  0 ) {
135136        /* When decompressing, use digested dictionary by default. */ 
136137        zd  =  (ZstdDict * )dict ;
137138        type  =  DICT_TYPE_DIGESTED ;
@@ -145,7 +146,8 @@ _PyZstd_load_d_dict(ZstdDecompressor *self, PyObject *dict)
145146                                  (PyObject * )mod_state -> ZstdDict_type );
146147        if  (ret  <  0 ) {
147148            return  -1 ;
148-         } else  if  (ret  >  0 ) {
149+         }
150+         else  if  (ret  >  0 ) {
149151            /* type == -1 may indicate an error. */ 
150152            type  =  PyLong_AsInt (PyTuple_GET_ITEM (dict , 1 ));
151153            if  (type  ==  DICT_TYPE_DIGESTED  || 
@@ -175,23 +177,26 @@ _PyZstd_load_d_dict(ZstdDecompressor *self, PyObject *dict)
175177        Py_BEGIN_CRITICAL_SECTION (self );
176178        zstd_ret  =  ZSTD_DCtx_refDDict (self -> dctx , d_dict );
177179        Py_END_CRITICAL_SECTION ();
178-     } else  if  (type  ==  DICT_TYPE_UNDIGESTED ) {
180+     }
181+     else  if  (type  ==  DICT_TYPE_UNDIGESTED ) {
179182        /* Load a dictionary */ 
180183        Py_BEGIN_CRITICAL_SECTION2 (self , zd );
181184        zstd_ret  =  ZSTD_DCtx_loadDictionary (
182185                            self -> dctx ,
183186                            PyBytes_AS_STRING (zd -> dict_content ),
184187                            Py_SIZE (zd -> dict_content ));
185188        Py_END_CRITICAL_SECTION2 ();
186-     } else  if  (type  ==  DICT_TYPE_PREFIX ) {
189+     }
190+     else  if  (type  ==  DICT_TYPE_PREFIX ) {
187191        /* Load a prefix */ 
188192        Py_BEGIN_CRITICAL_SECTION2 (self , zd );
189193        zstd_ret  =  ZSTD_DCtx_refPrefix (
190194                            self -> dctx ,
191195                            PyBytes_AS_STRING (zd -> dict_content ),
192196                            Py_SIZE (zd -> dict_content ));
193197        Py_END_CRITICAL_SECTION2 ();
194-     } else  {
198+     }
199+     else  {
195200        /* Impossible code path */ 
196201        PyErr_SetString (PyExc_SystemError ,
197202                        "load_d_dict() impossible code path" );
@@ -296,7 +301,8 @@ decompress_impl(ZstdDecompressor *self, ZSTD_inBuffer *in,
296301        if  (_OutputBuffer_InitWithSize (& buffer , & out , max_length , initial_size ) <  0 ) {
297302            goto error ;
298303        }
299-     } else  {
304+     }
305+     else  {
300306        if  (_OutputBuffer_InitAndGrow (& buffer , & out , max_length ) <  0 ) {
301307            goto error ;
302308        }
@@ -325,7 +331,8 @@ decompress_impl(ZstdDecompressor *self, ZSTD_inBuffer *in,
325331                self -> eof  =  1 ;
326332                break ;
327333            }
328-         } else  if  (type  ==  TYPE_ENDLESS_DECOMPRESSOR ) {
334+         }
335+         else  if  (type  ==  TYPE_ENDLESS_DECOMPRESSOR ) {
329336            /* decompress() function supports multiple frames */ 
330337            self -> at_frame_edge  =  (zstd_ret  ==  0 ) ? 1  : 0 ;
331338
@@ -351,7 +358,8 @@ decompress_impl(ZstdDecompressor *self, ZSTD_inBuffer *in,
351358            }
352359            assert (out .pos  ==  0 );
353360
354-         } else  if  (in -> pos  ==  in -> size ) {
361+         }
362+         else  if  (in -> pos  ==  in -> size ) {
355363            /* Finished */ 
356364            break ;
357365        }
@@ -406,7 +414,8 @@ stream_decompress(ZstdDecompressor *self, Py_buffer *data, Py_ssize_t max_length
406414            assert (ret  ==  NULL );
407415            goto success ;
408416        }
409-     } else  if  (type  ==  TYPE_ENDLESS_DECOMPRESSOR ) {
417+     }
418+     else  if  (type  ==  TYPE_ENDLESS_DECOMPRESSOR ) {
410419        /* Fast path for the first frame */ 
411420        if  (self -> at_frame_edge  &&  self -> in_begin  ==  self -> in_end ) {
412421            /* Read decompressed size */ 
@@ -435,7 +444,8 @@ stream_decompress(ZstdDecompressor *self, Py_buffer *data, Py_ssize_t max_length
435444        in .src  =  data -> buf ;
436445        in .size  =  data -> len ;
437446        in .pos  =  0 ;
438-     } else  if  (data -> len  ==  0 ) {
447+     }
448+     else  if  (data -> len  ==  0 ) {
439449        /* Has unconsumed data, fast path for b'' */ 
440450        assert (self -> in_begin  <  self -> in_end );
441451
@@ -444,7 +454,8 @@ stream_decompress(ZstdDecompressor *self, Py_buffer *data, Py_ssize_t max_length
444454        in .src  =  self -> input_buffer  +  self -> in_begin ;
445455        in .size  =  self -> in_end  -  self -> in_begin ;
446456        in .pos  =  0 ;
447-     } else  {
457+     }
458+     else  {
448459        /* Has unconsumed data */ 
449460        use_input_buffer  =  1 ;
450461
@@ -485,7 +496,8 @@ stream_decompress(ZstdDecompressor *self, Py_buffer *data, Py_ssize_t max_length
485496            /* Set begin & end position */ 
486497            self -> in_begin  =  0 ;
487498            self -> in_end  =  used_now ;
488-         } else  if  (avail_now  <  (size_t ) data -> len ) {
499+         }
500+         else  if  (avail_now  <  (size_t ) data -> len ) {
489501            /* Move unconsumed data to the beginning. 
490502               Overlap is possible, so use memmove(). */ 
491503            memmove (self -> input_buffer ,
@@ -520,13 +532,16 @@ stream_decompress(ZstdDecompressor *self, Py_buffer *data, Py_ssize_t max_length
520532        if  (type  ==  TYPE_DECOMPRESSOR ) {
521533            if  (Py_SIZE (ret ) ==  max_length  ||  self -> eof ) {
522534                self -> needs_input  =  0 ;
523-             } else  {
535+             }
536+             else  {
524537                self -> needs_input  =  1 ;
525538            }
526-         } else  if  (type  ==  TYPE_ENDLESS_DECOMPRESSOR ) {
539+         }
540+         else  if  (type  ==  TYPE_ENDLESS_DECOMPRESSOR ) {
527541            if  (Py_SIZE (ret ) ==  max_length  &&  !self -> at_frame_edge ) {
528542                self -> needs_input  =  0 ;
529-             } else  {
543+             }
544+             else  {
530545                self -> needs_input  =  1 ;
531546            }
532547        }
@@ -536,7 +551,8 @@ stream_decompress(ZstdDecompressor *self, Py_buffer *data, Py_ssize_t max_length
536551            self -> in_begin  =  0 ;
537552            self -> in_end  =  0 ;
538553        }
539-     } else  {
554+     }
555+     else  {
540556        size_t  data_size  =  in .size  -  in .pos ;
541557
542558        self -> needs_input  =  0 ;
@@ -570,7 +586,8 @@ stream_decompress(ZstdDecompressor *self, Py_buffer *data, Py_ssize_t max_length
570586            memcpy (self -> input_buffer , (char * )in .src  +  in .pos , data_size );
571587            self -> in_begin  =  0 ;
572588            self -> in_end  =  data_size ;
573-         } else  {
589+         }
590+         else  {
574591            /* Use input buffer */ 
575592            self -> in_begin  +=  in .pos ;
576593        }
@@ -726,14 +743,16 @@ _zstd_ZstdDecompressor_unused_data_get_impl(ZstdDecompressor *self)
726743        }
727744        ret  =  mod_state -> empty_bytes ;
728745        Py_INCREF (ret );
729-     } else  {
746+     }
747+     else  {
730748        if  (self -> unused_data  ==  NULL ) {
731749            self -> unused_data  =  PyBytes_FromStringAndSize (
732750                                    self -> input_buffer  +  self -> in_begin ,
733751                                    self -> in_end  -  self -> in_begin );
734752            ret  =  self -> unused_data ;
735753            Py_XINCREF (ret );
736-         } else  {
754+         }
755+         else  {
737756            ret  =  self -> unused_data ;
738757            Py_INCREF (ret );
739758        }
0 commit comments