From ba2ddb22d8c10f19a860c87c64458777a7b8a7b9 Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Wed, 31 Jul 2013 15:39:55 +0000 Subject: [PATCH] Fixed duplicate last line bug in load2D --- gtsam/slam/dataset.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gtsam/slam/dataset.cpp b/gtsam/slam/dataset.cpp index 46f8740f9..e22d0b42c 100644 --- a/gtsam/slam/dataset.cpp +++ b/gtsam/slam/dataset.cpp @@ -91,7 +91,8 @@ pair load2D( // load the poses while (is) { - is >> tag; + if(! (is >> tag)) + break; if ((tag == "VERTEX2") || (tag == "VERTEX")) { int id; @@ -113,7 +114,8 @@ pair load2D( // load the factors bool haveLandmark = false; while (is) { - is >> tag; + if(! (is >> tag)) + break; if ((tag == "EDGE2") || (tag == "EDGE") || (tag == "ODOMETRY")) { int id1, id2;