1
0
Fork 0

Return reference to non temporary string.

This commit is contained in:
Gary Preston 2017-04-05 17:49:58 +01:00 committed by James Turner
parent 8958b4d130
commit 5e5699c4d8

View file

@ -1,5 +1,7 @@
#include "fake_sgSky.hxx" #include "fake_sgSky.hxx"
static const std::string sEmptyString;
void SGSky::add_cloud_layer(SGCloudLayer *layer) void SGSky::add_cloud_layer(SGCloudLayer *layer)
{ {
_cloudLayers.push_back(layer); _cloudLayers.push_back(layer);
@ -22,12 +24,12 @@ void SGSky::set_clouds_enabled(bool enabled)
const std::string &SGCloudLayer::getCoverageString() const const std::string &SGCloudLayer::getCoverageString() const
{ {
return std::string(); return sEmptyString;
} }
const std::string &SGCloudLayer::getCoverageString(SGCloudLayer::Coverage coverage) const std::string &SGCloudLayer::getCoverageString(SGCloudLayer::Coverage coverage)
{ {
return std::string(); return sEmptyString;
} }
void SGCloudLayer::setCoverageString(const std::string &coverage) void SGCloudLayer::setCoverageString(const std::string &coverage)