optimized variables
This commit is contained in:
parent
36502ffbaf
commit
b569180ebd
@ -32,12 +32,13 @@ void clear(std::vector<phonebook_entry*> &phonebook) {
|
|||||||
|
|
||||||
std::vector<phonebook_entry*> getPhonebookFromFile(std::string filename) {
|
std::vector<phonebook_entry*> getPhonebookFromFile(std::string filename) {
|
||||||
std::ifstream file(filename);
|
std::ifstream file(filename);
|
||||||
std::string line;
|
|
||||||
int rownumber = 0;
|
|
||||||
std::vector<phonebook_entry*> phonebook;
|
std::vector<phonebook_entry*> phonebook;
|
||||||
phonebook_entry* entry;
|
phonebook_entry* entry;
|
||||||
|
|
||||||
if (file.is_open()) {
|
if (file.is_open()) {
|
||||||
|
int rownumber = 0;
|
||||||
|
std::string line;
|
||||||
|
|
||||||
while (file >> line) {
|
while (file >> line) {
|
||||||
switch (rownumber % 3) {
|
switch (rownumber % 3) {
|
||||||
case 0:
|
case 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user