diff --git a/ChangeLog b/ChangeLog index 83e043c7..7f74e174 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2010-05-08 Tatsuhiro Tsujikawa + + Return const reference. + * src/DefaultPieceStorage.h + * src/DownloadContext.h + * src/FeatureConfig.cc + * src/FeatureConfig.h + * src/OptionParser.cc + * src/OptionParser.h + * src/SimpleRandomizer.cc + * src/SimpleRandomizer.h + 2010-05-07 Tatsuhiro Tsujikawa Bump up version number to 1.9.3. diff --git a/src/DefaultPieceStorage.h b/src/DefaultPieceStorage.h index 01ed976d..bf4da0ba 100644 --- a/src/DefaultPieceStorage.h +++ b/src/DefaultPieceStorage.h @@ -243,7 +243,7 @@ public: _pieceSelector = pieceSelector; } - SharedHandle getPieceSelector() const + const SharedHandle& getPieceSelector() const { return _pieceSelector; } diff --git a/src/DownloadContext.h b/src/DownloadContext.h index 692ca052..563a601d 100644 --- a/src/DownloadContext.h +++ b/src/DownloadContext.h @@ -201,7 +201,7 @@ public: void setDir(const std::string& dir) { _dir = dir; } - SharedHandle getSignature() const { return _signature; } + const SharedHandle& getSignature() const { return _signature; } void setSignature(const SharedHandle& signature) { diff --git a/src/FeatureConfig.cc b/src/FeatureConfig.cc index 6f93449a..cdf2022c 100644 --- a/src/FeatureConfig.cc +++ b/src/FeatureConfig.cc @@ -120,7 +120,7 @@ FeatureConfig::FeatureConfig() { _features.insert(vbegin(featureArray), vend(featureArray)); } -SharedHandle FeatureConfig::getInstance() +const SharedHandle& FeatureConfig::getInstance() { if(_featureConfig.isNull()) { _featureConfig.reset(new FeatureConfig()); diff --git a/src/FeatureConfig.h b/src/FeatureConfig.h index 0877ecb3..05ef542e 100644 --- a/src/FeatureConfig.h +++ b/src/FeatureConfig.h @@ -56,7 +56,7 @@ private: FeatureConfig(); public: - static SharedHandle getInstance(); + static const SharedHandle& getInstance(); uint16_t getDefaultPort(const std::string& protocol) const; diff --git a/src/OptionParser.cc b/src/OptionParser.cc index 5508dc8a..9553ecf9 100644 --- a/src/OptionParser.cc +++ b/src/OptionParser.cc @@ -369,7 +369,7 @@ SharedHandle OptionParser::findByShortName(char shortName) const SharedHandle OptionParser::_optionParser; -SharedHandle OptionParser::getInstance() +const SharedHandle& OptionParser::getInstance() { if(_optionParser.isNull()) { _optionParser.reset(new OptionParser()); diff --git a/src/OptionParser.h b/src/OptionParser.h index 8294d3ed..1abf7167 100644 --- a/src/OptionParser.h +++ b/src/OptionParser.h @@ -101,7 +101,7 @@ public: // Hidden options are not returned. SharedHandle findByShortName(char shortName) const; - static SharedHandle getInstance(); + static const SharedHandle& getInstance(); }; typedef SharedHandle OptionParserHandle; diff --git a/src/SimpleRandomizer.cc b/src/SimpleRandomizer.cc index b0fcb98c..2f7d8504 100644 --- a/src/SimpleRandomizer.cc +++ b/src/SimpleRandomizer.cc @@ -42,7 +42,7 @@ namespace aria2 { SharedHandle SimpleRandomizer::_randomizer; -SharedHandle SimpleRandomizer::getInstance() +const SharedHandle& SimpleRandomizer::getInstance() { if(_randomizer.isNull()) { _randomizer.reset(new SimpleRandomizer()); diff --git a/src/SimpleRandomizer.h b/src/SimpleRandomizer.h index 5bf32929..cbecaf6a 100644 --- a/src/SimpleRandomizer.h +++ b/src/SimpleRandomizer.h @@ -46,7 +46,7 @@ private: SimpleRandomizer(); public: - static SharedHandle getInstance(); + static const SharedHandle& getInstance(); static void init();