CB100

Notas, resueltos y tps de la materia Algoritmos y Estructuras de Datos
Index Commits Files Refs README
commit cff111385428d7be96122718757c8178e83089f6
parent f034af42670979386f334054100e9a43f7269e3a
Author: Martin Kloeckner <mjkloeckner@gmail.com>
Date:   Fri, 28 Jun 2024 12:55:49 -0300

remove unnecesary attributes from `Menu`

Diffstat:
Mmenu.cpp | 6+++---
Mmenu.h | 2--
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/menu.cpp b/menu.cpp
@@ -109,9 +109,6 @@ void Menu::cantidadDeParadasPorLinea() {
 Menu::Menu() {
     this->barrios = new List<Barrio*>;
     this->lineas = new std::vector<int>;
-
-    this->linea = 0;
-    this->coordX = this->coordY = 0.0f;
 }
 
 std::string strToLowercase(std::string str) {
@@ -270,6 +267,7 @@ void Menu::cargarDatos() {
     std::string token, line;
     std::vector<std::string> tokens;
     std::vector<int> lineasEnParada;
+    float coordX, coordY;
     Barrio *barrio;
 
     const char *inputFilePath = "paradas-de-colectivo.csv";
@@ -282,6 +280,8 @@ void Menu::cargarDatos() {
         std::cout << "No se pudo abrir el archivo `" << inputFilePath << "`\n";
     }
 
+    coordX = coordY = 0.0f;
+
     std::getline(inputFile, line); // saltea la primer linea
 
     while(std::getline(inputFile, line)) {
diff --git a/menu.h b/menu.h
@@ -33,9 +33,7 @@ enum {
 
 class Menu {
 private:
-    int linea;
     List<Barrio*> *barrios;
-    double coordX, coordY;
     std::vector<int> *lineas;
 
 private: