diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2024-01-23 10:13:00 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2024-01-23 10:13:00 +0900 |
commit | d2f343cc239e1fa25c9581cf35bada96692c41db (patch) | |
tree | 52a60c0c804e42a990ffb27ca69c54d7467ea814 /indexlib/quotes.cpp | |
parent | 3b3f9ec8f31978030c17309fae48335bea5c1587 (diff) | |
download | tdepim-d2f343cc239e1fa25c9581cf35bada96692c41db.tar.gz tdepim-d2f343cc239e1fa25c9581cf35bada96692c41db.zip |
Replace auto_ptr
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'indexlib/quotes.cpp')
-rw-r--r-- | indexlib/quotes.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/indexlib/quotes.cpp b/indexlib/quotes.cpp index e4c35db4..abf8915c 100644 --- a/indexlib/quotes.cpp +++ b/indexlib/quotes.cpp @@ -68,12 +68,12 @@ void quotes::remove_doc( const char* doc ) { impl_.remove_doc( doc ); } -std::auto_ptr<indexlib::result> quotes::search( const char* cstr ) const { +std::unique_ptr<indexlib::result> quotes::search( const char* cstr ) const { std::string str = cstr; if ( str[ 0 ] != '\"' ) return impl_.search( cstr ); str = cstr + 1; // cut " if ( str.size() && str[ str.size() - 1 ] == '\"' ) str.erase( str.size() - 1 ); - std::auto_ptr<indexlib::result> prev = impl_.search( str.c_str() ); + std::unique_ptr<indexlib::result> prev = impl_.search( str.c_str() ); if ( str.find( ' ' ) != std::string::npos ) { indexlib::Match m( str ); std::vector<unsigned> candidates = prev->list(); @@ -86,7 +86,7 @@ std::auto_ptr<indexlib::result> quotes::search( const char* cstr ) const { res.push_back( *first ); } } - return std::auto_ptr<indexlib::result>( new indexlib::detail::simple_result( res ) ); + return std::unique_ptr<indexlib::result>( new indexlib::detail::simple_result( res ) ); } else { return prev; } } |