-
Notifications
You must be signed in to change notification settings - Fork 117
refactor(maputil): Remove unused variables in MapUtil #1767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(maputil): Remove unused variables in MapUtil #1767
Conversation
|
loadmap() and loadUserMaps() still need attention |
Done. Also I found one more spot with a variable that wasn't being used, cleaned it up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if all the refactor comments are needed. I leave that up for Xezon. Otherwise this looks good.
I agree here, it's not changing any functionality that a future dev would need to know about, I was just trying to follow contributing guidelines - I think it's better to leave out the comments |
| File *fp; | ||
| asciiFile = fname; | ||
| fp = TheFileSystem->openFile(asciiFile.str(), File::READ); | ||
| File *fp = TheFileSystem->openFile(fname.str(), File::READ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it correct that this does not use dirName? Does it work with User Maps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, in the original code (main branch line 84), calcCRC declared dirName as a parameter but never used it. The function only used fname to open the file.
fname comes from getFileListInDirectory, which returns either relative (standard maps) or absolute path (user maps)
TheFileSystem->openFile() handles both eg MapCache::loadStandardMaps and MapCache::loadUserMaps
b5a91eb to
df6cec2
Compare
Removes dead code from the
calcCRCstatic function in MapUtil.cppThe function declared several variables (
dirNameparameter,asciiFile,tempBuf,filenameBuf) that were never used. The function only needs thefnameparameter to compute the CRC of a map file.Changes:
dirNameparameter from function signatureasciiFile,tempBuf,filenameBuf,lengthfname