Skip to content

Upgrade AIO::path String to SBuf - #2463

Open
yadij wants to merge 1 commit into
squid-cache:masterfrom
yadij:rm-AIOString-1
Open

Upgrade AIO::path String to SBuf#2463
yadij wants to merge 1 commit into
squid-cache:masterfrom
yadij:rm-AIOString-1

Conversation

@yadij

@yadij yadij commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Also, C++11 initialize the class to simplify constructor.

@yadij yadij changed the title Update AIO::path String to SBuf Upgrade AIO::path String to SBuf Jul 27, 2026

@kinkie kinkie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment; apart from that LGTM

Comment on lines +41 to +42
assert(!path.isEmpty());
debugs(79, 3, "AIODiskFile::AIODiskFile: " << path);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Swapping these around and adding file delimiters would give better debuggability for free

Suggested change
assert(!path.isEmpty());
debugs(79, 3, "AIODiskFile::AIODiskFile: " << path);
debugs(79, 3, "AIODiskFile::AIODiskFile: '" << path << '\'');
assert(!path.isEmpty());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not add "file delimiters".

@rousskov rousskov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All change requests are about out-of-scope PR changes.

Please do not post new non-emergency PRs until the backlog problem is solved.

Comment on lines +41 to +42
assert(!path.isEmpty());
debugs(79, 3, "AIODiskFile::AIODiskFile: " << path);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not add "file delimiters".

strategy = aStrategy;
debugs(79, 3, "AIODiskFile::AIODiskFile: " << aPath);
assert(!path.isEmpty());
debugs(79, 3, "AIODiskFile::AIODiskFile: " << path);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you modify this debugs(), please drop AIODiskFile::AIODiskFile prefix. Those words are already automatically printed by modern debugs() statements.

Suggested change
debugs(79, 3, "AIODiskFile::AIODiskFile: " << path);
debugs(79, 3, path);

AIODiskIOStrategy *strategy;
int fd = -1;
SBuf path;
AIODiskIOStrategy *strategy = nullptr;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Suggested change
AIODiskIOStrategy *strategy = nullptr;
AIODiskIOStrategy *strategy;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants