Angus Leeming <[EMAIL PROTECTED]> writes:

| As "data" is a static variable, shouldn't this function return a 
| reference?

I'd rather remove the static.

It makes the funciton non-reentrant for no good reason.
And if it needs to cache anything is should be done as a class
variable not as a static var inside a member function.

| vector<string> const ControlGraphics::getUnits()
| {
|         static vector<string> data;
|         if (!data.empty())
|                 return data;
>
|         data.resize(bb_size);
|         for (lyx::size_type i = 0; i < bb_size; ++i) {
|                 data[i] = bb_units[i];
|         }
|         return data;
| }

-- 
        Lgb

Reply via email to