Code style fixes

This commit is contained in:
Strahinja Val Markovic 2013-04-29 19:24:28 -07:00
parent f25bf2f6c8
commit 7f676f85ae
4 changed files with 32 additions and 28 deletions

View File

@ -69,9 +69,9 @@ std::vector< const Candidate * > CandidateRepository::GetCandidatesForStrings(
empty_;
const Candidate *&candidate = GetValueElseInsert(
candidate_holder_,
validated_candidate_text,
NULL );
candidate_holder_,
validated_candidate_text,
NULL );
if ( !candidate )
candidate = new Candidate( validated_candidate_text );

View File

@ -178,10 +178,10 @@ Future< void > ClangCompleter::UpdateTranslationUnitAsync(
std::vector< std::string > flags ) {
function< void() > functor =
boost::bind( &ClangCompleter::UpdateTranslationUnit,
boost::ref( *this ),
boost::move( filename ),
boost::move( unsaved_files ),
boost::move( flags ) );
boost::ref( *this ),
boost::move( filename ),
boost::move( unsaved_files ),
boost::move( flags ) );
shared_ptr< ClangPackagedTask > clang_packaged_task =
make_shared< ClangPackagedTask >();
@ -272,9 +272,11 @@ Location ClangCompleter::GetDeclarationLocation(
filename,
unsaved_files,
flags );
if (!unit) {
if ( !unit ) {
return Location();
}
return unit->GetDeclarationLocation( line, column, unsaved_files );
}
@ -289,9 +291,11 @@ Location ClangCompleter::GetDefinitionLocation(
filename,
unsaved_files,
flags );
if (!unit) {
if ( !unit ) {
return Location();
}
return unit->GetDefinitionLocation( line, column, unsaved_files );
}
@ -340,19 +344,19 @@ void ClangCompleter::CreateSortingTask(
function< CompletionDatas( const CompletionDatas & ) >
sort_candidates_for_query_functor =
boost::bind( &ClangCompleter::SortCandidatesForQuery,
boost::ref( *this ),
query,
_1 );
boost::ref( *this ),
query,
_1 );
function< CompletionDatas() > operate_on_completion_data_functor =
boost::bind( &ClangResultsCache::OperateOnCompletionDatas< CompletionDatas >,
boost::cref( latest_clang_results_ ),
boost::move( sort_candidates_for_query_functor ) );
boost::cref( latest_clang_results_ ),
boost::move( sort_candidates_for_query_functor ) );
shared_ptr< packaged_task< AsyncCompletions > > task =
boost::make_shared< packaged_task< AsyncCompletions > >(
boost::bind( ReturnValueAsShared< std::vector< CompletionData > >,
boost::move( operate_on_completion_data_functor ) ) );
boost::move( operate_on_completion_data_functor ) ) );
future = task->get_future();
sorting_task_.Set( task );
@ -369,12 +373,12 @@ void ClangCompleter::CreateClangTask(
function< CompletionDatas() > candidates_for_location_functor =
boost::bind( &ClangCompleter::CandidatesForLocationInFile,
boost::ref( *this ),
boost::move( filename ),
line,
column,
boost::move( unsaved_files ),
boost::move( flags ) );
boost::ref( *this ),
boost::move( filename ),
line,
column,
boost::move( unsaved_files ),
boost::move( flags ) );
shared_ptr< ClangPackagedTask > clang_packaged_task =
make_shared< ClangPackagedTask >();
@ -382,7 +386,7 @@ void ClangCompleter::CreateClangTask(
clang_packaged_task->completions_task_ =
packaged_task< AsyncCompletions >(
boost::bind( ReturnValueAsShared< std::vector< CompletionData > >,
boost::move( candidates_for_location_functor ) ) );
boost::move( candidates_for_location_functor ) ) );
clang_task_.Set( clang_packaged_task );
}

View File

@ -130,8 +130,8 @@ CompilationDatabase::GetCompilationInfoForFileAsync(
function< CompilationInfoForFile() > functor =
boost::bind( &CompilationDatabase::GetCompilationInfoForFile,
boost::ref( *this ),
path_to_file );
boost::ref( *this ),
path_to_file );
InfoTask task =
make_shared< packaged_task< AsyncCompilationInfoForFile > >(

View File

@ -27,8 +27,8 @@ TEST( CandidateRepositoryTest, EmptyCandidatesForUnicode ) {
inputs.push_back( "fooδιακριτικός" );
inputs.push_back( "fooδιακός" );
CandidateRepository& repo = CandidateRepository::Instance();
std::vector< const Candidate* > candidates =
CandidateRepository &repo = CandidateRepository::Instance();
std::vector< const Candidate * > candidates =
repo.GetCandidatesForStrings( inputs );
EXPECT_EQ( "", candidates[ 0 ]->Text() );
@ -40,8 +40,8 @@ TEST( CandidateRepositoryTest, EmptyCandidatesForNonPrintable ) {
std::vector< std::string > inputs;
inputs.push_back( "\x01\x05\x0a\x15" );
CandidateRepository& repo = CandidateRepository::Instance();
std::vector< const Candidate* > candidates =
CandidateRepository &repo = CandidateRepository::Instance();
std::vector< const Candidate * > candidates =
repo.GetCandidatesForStrings( inputs );
EXPECT_EQ( "", candidates[ 0 ]->Text() );