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-26 11:05:01 +0900 |
| commit | 3b1e4bbb3df6a0de8aa0693038449c6f0359ce91 (patch) | |
| tree | 068068e7b1b6202c635bd655e346f838d715373c /indexlib/quotes.cpp | |
| parent | b0f8eef013163b2098c2bb07e93cb9b194338b80 (diff) | |
| download | tdepim-3b1e4bbb.tar.gz tdepim-3b1e4bbb.zip | |
Replace auto_ptr
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit d2f343cc239e1fa25c9581cf35bada96692c41db)
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; } } |
