Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

History_Manager: Move static variable to outside of fucntion #998

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/history/historymanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -461,24 +461,23 @@ bool History_Manager::replace_current_title_viewhistory( const std::string& url,
}


static std::vector<ViewHistoryItem*> s_nullitems;


// item の取得
std::vector< ViewHistoryItem* >& History_Manager::get_items_back_viewhistory( const std::string& url, const int count )
{
static std::vector< ViewHistoryItem* > nullitems;

ViewHistory* history = get_viewhistory( url );
if( !history ) return nullitems;
if( !history ) return s_nullitems;

return history->get_items_back( count );
}


std::vector< ViewHistoryItem* >& History_Manager::get_items_forward_viewhistory( const std::string& url, const int count )
{
static std::vector< ViewHistoryItem* > nullitems;

ViewHistory* history = get_viewhistory( url );
if( !history ) return nullitems;
if( !history ) return s_nullitems;

return history->get_items_forward( count );
}
Expand Down