Skip to content
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

Minor code cleanups 2 #6171

Merged
merged 3 commits into from
Nov 5, 2024
Merged

Minor code cleanups 2 #6171

merged 3 commits into from
Nov 5, 2024

Conversation

antkmsft
Copy link
Member

@antkmsft antkmsft commented Nov 4, 2024

No description provided.

@antkmsft antkmsft added the MQ This issue is part of a "milestone of quality" initiative. label Nov 4, 2024
@antkmsft antkmsft self-assigned this Nov 4, 2024
@azure-sdk
Copy link
Collaborator

azure-sdk commented Nov 4, 2024

API change check

API changes are not detected in this pull request.

@antkmsft
Copy link
Member Author

antkmsft commented Nov 4, 2024

@antkmsft antkmsft merged commit 868a14f into Azure:main Nov 5, 2024
112 checks passed
@antkmsft antkmsft deleted the cleanups2 branch November 5, 2024 18:12
@@ -327,7 +327,7 @@ namespace Azure { namespace Core { namespace Http {
* @brief A value indicating whether the returned raw response for this request will be buffered
* within a memory buffer or if it will be returned as a body stream instead.
*/
bool ShouldBufferResponse() { return this->m_shouldBufferResponse; }
bool ShouldBufferResponse() const { return this->m_shouldBufferResponse; }
Copy link
Member

Choose a reason for hiding this comment

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

To confirm, removing const from a method is considered a breaking change, correct?

But adding is fine. Because a const method can be called on either a const or non-const instance, whereas a non-const method cannot be called by a const instance.

In general, I wonder how pessimistic we should be with adding const, to avoid a breaking change, if the implementation were required to change.

@@ -8,10 +8,10 @@

namespace {

static char const Base64EncodeArray[65]
Copy link
Member

Choose a reason for hiding this comment

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

What's the rationale here to remove static?

Copy link
Member

Choose a reason for hiding this comment

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

Not 100% sure if this is the logic from the tools that Anton is running, but declaring the type as "static" removes the symbol from the symbol table, which makes it impossible to address from outside the module.

But putting the type in an anonymous namespace has the identical effect, so it mostly just makes it harder to debug things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MQ This issue is part of a "milestone of quality" initiative.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants