minor code refactoring, wip

This commit is contained in:
Dennis Luxen
2014-05-18 22:44:19 +02:00
parent a122a1e8c7
commit 75a2d4d00a
12 changed files with 315 additions and 324 deletions
+2
View File
@@ -28,6 +28,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "PolylineCompressor.h"
#include "../Util/StringUtil.h"
//TODO: return vector of start indices for each leg
void PolylineCompressor::encodeVectorSignedNumber(std::vector<int> &numbers, std::string &output)
const
{
+11 -8
View File
@@ -339,14 +339,17 @@ class TarjanSCC
<< " many components, marking small components";
// TODO/C++11: prime candidate for lambda function
unsigned size_one_counter = 0;
for (unsigned i = 0, end = component_size_vector.size(); i < end; ++i)
{
if (1 == component_size_vector[i])
{
++size_one_counter;
}
}
// unsigned size_one_counter = 0;
// for (unsigned i = 0, end = component_size_vector.size(); i < end; ++i)
// {
// if (1 == component_size_vector[i])
// {
// ++size_one_counter;
// }
// }
unsigned size_one_counter = std::count_if(component_size_vector.begin(),
component_size_vector.end(),
[] (unsigned value) { return 1 == value;});
SimpleLogger().Write() << "identified " << size_one_counter << " SCCs of size 1";