> > +
> > +    def check_and_add_to_watched_files(filename)
> > +        unless @files.detect { |name, f| f.file == filename }
> > +            @files[filename] = Puppet::Util::LoadedFile.new(filename)
> > +            return true
> > +        else
> > +            return false
> >         end
> >     end
>
> ...you still use f.file == filename.  You can instead just do this:


Good catch, got distracted by the historical code


> I'm also not entirely sure the extra check_and... method is necessary,
> but I'm fine with it.
>

In general, and when possible, I want code to have one and only one way to
add to a data structure (or do anything for that matter).  The true/false
logic was added to preserve the original behavior with the lexer.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to