[SVN] r7278 (C, Objective-C) for loop changes

Chris Thomas chris at cjack.com
Thu Jul 12 17:19:02 UTC 2007


> -	<string>for( ${1:unsigned int} ${2:i} = ${3:0}; ${2:i} <  
> ${4:count}; ${2:i} += ${5:1} )
> +	<string>for(size_t ${2:i} = 0; $2 < ${1:count}; ${3:++$2})

This change didn't show up for me until now (strange, because other  
recent changes did).
It diminishes the value of the for loop snippet considerably, IMO:

- A size_t makes sense for looping over byte arrays in primarily-stdio  
code, but for nothing else. Can we resnippetize the variable type?
- Any use of ++ is bad practice, it makes the variable value undefined  
anywhere else in the current expression. This is not a fun bug to  
track down when you get bitten by it.
- Use of prefix ++ here looks weird.

Thanks,
Chris




More information about the textmate-dev mailing list