From 5e5699c4d8e1bda79a957d35c9636b150cdaf3c5 Mon Sep 17 00:00:00 2001 From: Gary Preston Date: Wed, 5 Apr 2017 17:49:58 +0100 Subject: [PATCH] Return reference to non temporary string. --- tests/fake_sgSky.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/fake_sgSky.cxx b/tests/fake_sgSky.cxx index 492403c7f..2940d5aa9 100644 --- a/tests/fake_sgSky.cxx +++ b/tests/fake_sgSky.cxx @@ -1,5 +1,7 @@ #include "fake_sgSky.hxx" +static const std::string sEmptyString; + void SGSky::add_cloud_layer(SGCloudLayer *layer) { _cloudLayers.push_back(layer); @@ -22,12 +24,12 @@ void SGSky::set_clouds_enabled(bool enabled) const std::string &SGCloudLayer::getCoverageString() const { - return std::string(); + return sEmptyString; } const std::string &SGCloudLayer::getCoverageString(SGCloudLayer::Coverage coverage) { - return std::string(); + return sEmptyString; } void SGCloudLayer::setCoverageString(const std::string &coverage)