The Trunk: Kernel-nice.380.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Kernel-nice.380.mcz

commits-2
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 !


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-nice.380.mcz

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

2010/1/19  <[hidden email]>:

> 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 !
>
>
>