|
Boost-Build : |
From: Vladimir Prus (ghost_at_[hidden])
Date: 2003-05-13 01:06:56
David Abrahams wrote:
> In scanning the codebase, I'm seeing stuff like this fairly often:
>
> rule set-property-adjuster ( property-adjuster )
> {
> for local name in $(self.main-targets)
> {
> local t = [ main-target $(name) ] ;
> result += [ $(t).set-property-adjuster $(property-adjuster) ] ;
> }
> ...
>
> rule actualize ( )
> {
> if ! $(self.actualized)
> {
> self.actualized = true ;
>
> local actual-targets ;
> for local i in [ targets ]
> {
> actual-targets += [ $(i).actualize ] ;
> }
> }
> }
>
>
> What these rules have in common is that discarded (often empty)
> results of indirect rule invocations are needlessly stored in a
> variable. Note that in the first case, result is not even declared
> local! It seems to me the code would've been much cleaner as:
[...]
Oh... that's result of copy-paste! I surely never do that ;-)
Yes, in both cases the assignment is not necessary and can be dropped.
- Volodya
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk