[squeak-dev] The Trunk: Kernel-nice.380.mcz

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Mon Jan 18 23:41:03 UTC 2010


It's not only faster, it also works with line feeds

2010/1/19  <commits at source.squeak.org>:
> Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
> http://source.squeak.org/trunk/Kernel-nice.380.mcz
>
> ==================== Summary ====================
>
> Name: Kernel-nice.380
> Author: nice
> Time: 19 January 2010, 12:38:51.701 am
> UUID: 06edff56-56d3-4b50-baf5-34cdd716ca88
> Ancestors: Kernel-nice.379
>
> Fast-up linesOfCode
>
> =============== Diff against Kernel-nice.379 ===============
>
> Item was changed:
>  ----- Method: CompiledMethod>>linesOfCode (in category 'source code management') -----
>  linesOfCode
>        "An approximate measure of lines of code.
> +       Includes comments, but excludes empty lines."
> +       | lines |
> -       Includes comments, but excludes blank lines."
> -       | strm line lines |
>        lines := 0.
> +       self getSource asString lineIndicesDo: [:start :endWithoutDelimiters :end |
> +               endWithoutDelimiters > start ifTrue: [lines := lines+1]].
> +       ^lines!
> -       strm := ReadStream on: self getSource.
> -               [strm atEnd] whileFalse:
> -                       [line := strm upTo: Character cr.
> -                       line isEmpty ifFalse: [lines := lines+1]].
> -       ^lines !
>
>
>



More information about the Squeak-dev mailing list