Skip to content

Commit 30ae557

Browse files
committed
update to use a service object instead of using getvalue
1 parent 462afb7 commit 30ae557

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

src/aws-cpp-sdk-core/include/aws/core/config/AWSProfileConfig.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,16 @@ namespace Aws
2727
{
2828
public:
2929
inline const Aws::Map<Aws::String, Aws::String>& GetEndpoints() const { return m_endpoints; }
30-
inline const Aws::String& GetServiceName() const { return m_name; }
31-
inline bool IsSet() const { return m_isSet; }
30+
inline const Aws::String& GetServiceBlockName() const { return m_name; }
31+
inline bool IsSet() const { return !m_name.empty(); }
3232
private:
3333
friend class ConfigFileProfileFSM;
3434
void SetEndpoints(Aws::Map<Aws::String, Aws::String>&& endpoints, Aws::String name) {
3535
m_endpoints = std::move(endpoints);
3636
m_name = std::move(name);
37-
m_isSet = true;
3837
}
3938
Aws::Map<Aws::String, Aws::String> m_endpoints;
4039
Aws::String m_name;
41-
bool m_isSet = false;
4240
};
4341

4442
/*

src/aws-cpp-sdk-core/source/config/AWSConfigFileProfileConfigLoader.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -214,16 +214,11 @@ namespace Aws
214214
if (!servicesRef.empty())
215215
{
216216
auto servicesBlk = m_services.find(servicesRef);
217-
if (servicesBlk == m_services.end())
218-
{
219-
// Services section exists but has no endpoints (all content was ignored)
220-
Aws::Map<Aws::String, Aws::String> emptyEndpoints;
221-
profile.m_services.SetEndpoints(std::move(emptyEndpoints), servicesRef);
222-
}
223-
else
224-
{
225-
profile.m_services.SetEndpoints(std::move(servicesBlk->second), servicesRef);
217+
Aws::Map<Aws::String, Aws::String> endpoints;
218+
if (servicesBlk != m_services.end()) {
219+
endpoints = std::move(servicesBlk->second);
226220
}
221+
profile.m_services.SetEndpoints(std::move(endpoints), servicesRef);
227222
}
228223
}
229224

0 commit comments

Comments
 (0)