Continued Resource::Manger cleanup (JIRA RIPD-372)

 - Incorporates review comments from previous commit.
 - Increases Resource::Manager unit test coverage: verify a dropped consumer is blocked for a while.

As I said, it has its place, but we're talking about a variable whose scope
is a tiny number of lines, not RippleCalc!  :-)


On Wed, Jul 16, 2014 at 12:44 PM, Vinnie Falco <notifications@github.com>
wrote:

> In src/ripple/resource/impl/Logic.h:
>
> > @@ -506,13 +529,20 @@ class Logic
> >      {
> >          bool drop (false);
> >          clock_type::time_point const now (m_clock.now());
> > -        if (entry.balance (now) >= dropThreshold)
> > +        int const balance (entry.balance (now));
>
> Meyers also doesn't write functions like RippleCalc. While this example
> may not be the best, it is often the case in large functions riddled with
> technical debt that they have many local variables (as you can attest).
> Marking as many as possible const enforces the invariant that "this
> computed value does not change later in the function." - a real problem
> with these large functions.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/ripple/rippled/pull/448/files#r15011437>.
>