mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
commit
98aee93b0a
|
@ -10207,7 +10207,7 @@ Note that this applies most urgently to library code and least urgently to stand
|
||||||
static double cached_result = COMPUTATION_OF_ZERO;
|
static double cached_result = COMPUTATION_OF_ZERO;
|
||||||
double result;
|
double result;
|
||||||
|
|
||||||
if (cached_x = x)
|
if (cached_x == x)
|
||||||
return cached_result;
|
return cached_result;
|
||||||
result = computation(x);
|
result = computation(x);
|
||||||
cached_x = x;
|
cached_x = x;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user