diff options
author | Kayo Hamid <kayo.hamid@gekkolinux.com.br> | 2011-04-22 11:31:04 +0200 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr> | 2011-04-22 11:31:04 +0200 |
commit | ee0110327ab820f255eb486b1afa8381087dee2f (patch) | |
tree | be53987876d76b55212ad6ca0b69cd5150c0d762 /chart2 | |
parent | 9864542a3f8628471c5925ca79e5426a8d3c9ded (diff) |
cppcheck inefficient checking for emptiness
From cppcheck: Using xxxx.empty() instead of xxxx.size() can be faster.
xxxx.size() can take linear time but xxxx.empty() is guaranteed to take
constant time
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/view/main/ChartView.cxx | 2 | ||||
-rw-r--r-- | chart2/source/view/main/VDataSeries.cxx | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index 9200f6974149..1f18435409db 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -762,7 +762,7 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter( } //transport seriesnames to the coordinatesystems if needed - if( m_aSeriesPlotterList.size() ) + if( !m_aSeriesPlotterList.empty() ) { uno::Sequence< rtl::OUString > aSeriesNames; bool bSeriesNamesInitialized = false; diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx index e0002ae641fa..e63dba596ed0 100644 --- a/chart2/source/view/main/VDataSeries.cxx +++ b/chart2/source/view/main/VDataSeries.cxx @@ -113,7 +113,7 @@ struct lcl_LessXOfPoint inline bool operator() ( const std::vector< double >& first, const std::vector< double >& second ) { - if( first.size() > 0 && second.size() > 0 ) + if( !first.empty() && !second.empty() ) { return first[0]<second[0]; } |