in reply to Re: Reading a Line from a File then Assigning it to a variable
in thread Reading a Line from a File then Assigning it to a variable

"...I know that many monks would tell you not to load the contents of the file ..."

Yeah, you guessed that right. What you are essentially doing is reading the file once and then repeatedly splitting each line. Let's say this was production code and you read in the file in that array in the beginning and hold it in memory to processing. Each time you encounter a packet you have to perform the same split over again on the line. Why not split earlier and store in a data structure to save clock cycles?

Celebrate Intellectual Diversity

  • Comment on Re^2: Reading a Line from a File then Assigning it to a variable