Upgrade AIO::path String to SBuf - #2463
Conversation
kinkie
left a comment
There was a problem hiding this comment.
One comment; apart from that LGTM
| assert(!path.isEmpty()); | ||
| debugs(79, 3, "AIODiskFile::AIODiskFile: " << path); |
There was a problem hiding this comment.
Swapping these around and adding file delimiters would give better debuggability for free
| assert(!path.isEmpty()); | |
| debugs(79, 3, "AIODiskFile::AIODiskFile: " << path); | |
| debugs(79, 3, "AIODiskFile::AIODiskFile: '" << path << '\''); | |
| assert(!path.isEmpty()); |
There was a problem hiding this comment.
Please do not add "file delimiters".
rousskov
left a comment
There was a problem hiding this comment.
All change requests are about out-of-scope PR changes.
Please do not post new non-emergency PRs until the backlog problem is solved.
| assert(!path.isEmpty()); | ||
| debugs(79, 3, "AIODiskFile::AIODiskFile: " << path); |
There was a problem hiding this comment.
Please do not add "file delimiters".
| strategy = aStrategy; | ||
| debugs(79, 3, "AIODiskFile::AIODiskFile: " << aPath); | ||
| assert(!path.isEmpty()); | ||
| debugs(79, 3, "AIODiskFile::AIODiskFile: " << path); |
There was a problem hiding this comment.
If you modify this debugs(), please drop AIODiskFile::AIODiskFile prefix. Those words are already automatically printed by modern debugs() statements.
| debugs(79, 3, "AIODiskFile::AIODiskFile: " << path); | |
| debugs(79, 3, path); |
| AIODiskIOStrategy *strategy; | ||
| int fd = -1; | ||
| SBuf path; | ||
| AIODiskIOStrategy *strategy = nullptr; |
There was a problem hiding this comment.
If this data member must be set by the class constructor, then it is best to leave it uninitialized here to avoid implying that some reasonable initial or default value exists:
| AIODiskIOStrategy *strategy = nullptr; | |
| AIODiskIOStrategy *strategy; |
Also, C++11 initialize the class to simplify constructor.