Changes between Version 18 and Version 19 of Hacking


Ignore:
Timestamp:
12/29/11 08:59:20 (12 years ago)
Author:
andrew_b
Comment:

Variable initialization

Legend:

Unmodified
Added
Removed
Modified
  • Hacking

    v18 v19  
    194194}}} 
    195195 
     196=== Variable initialization === 
     197 
     198Try to avoid using functions to initialize variables. Split variable declaration and value assignment. 
     199 
     200'''This is right:''' 
     201{{{ 
     202        vfs_path_t *vpath; 
     203 
     204        vpath = vfs_path_from_str (filename); 
     205}}} 
     206 
     207'''This is wrong:''' 
     208{{{ 
     209        vfs_path_t *vpath = vfs_path_from_str (filename); 
     210}}} 
     211 
    196212=== Make use of helper variables === 
    197213 
     
    212228    ... 
    213229    recalculate_panel_summary (panel); 
    214  
    215230} 
    216231