diff options
| author | Jonas Devlieghere <jonas@devlieghere.com> | 2018-12-20 21:02:55 +0000 |
|---|---|---|
| committer | Jonas Devlieghere <jonas@devlieghere.com> | 2018-12-20 21:02:55 +0000 |
| commit | 3447077a2878b71e0ced355f9a92a815706a0b11 (patch) | |
| tree | 9568b7fc75bb6345952fa01bc71bda11454d507e /lldb/source/API/SBStream.cpp | |
| parent | 0a90d7c92b1fa5b7193e7b0e1e0314ab46e76b70 (diff) | |
| download | bcm5719-llvm-3447077a2878b71e0ced355f9a92a815706a0b11.tar.gz bcm5719-llvm-3447077a2878b71e0ced355f9a92a815706a0b11.zip | |
[API] Remove redundants get() from smart pointers. NFC
Removes redundant calls to ::get() from smart pointers in the source/API
directory..
llvm-svn: 349821
Diffstat (limited to 'lldb/source/API/SBStream.cpp')
| -rw-r--r-- | lldb/source/API/SBStream.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lldb/source/API/SBStream.cpp b/lldb/source/API/SBStream.cpp index 5dea4595910..876ef02170d 100644 --- a/lldb/source/API/SBStream.cpp +++ b/lldb/source/API/SBStream.cpp @@ -25,12 +25,12 @@ SBStream::SBStream(SBStream &&rhs) SBStream::~SBStream() {} -bool SBStream::IsValid() const { return (m_opaque_ap.get() != NULL); } +bool SBStream::IsValid() const { return (m_opaque_ap != NULL); } // If this stream is not redirected to a file, it will maintain a local cache // for the stream data which can be accessed using this accessor. const char *SBStream::GetData() { - if (m_is_file || m_opaque_ap.get() == NULL) + if (m_is_file || m_opaque_ap == NULL) return NULL; return static_cast<StreamString *>(m_opaque_ap.get())->GetData(); @@ -39,7 +39,7 @@ const char *SBStream::GetData() { // If this stream is not redirected to a file, it will maintain a local cache // for the stream output whose length can be accessed using this accessor. size_t SBStream::GetSize() { - if (m_is_file || m_opaque_ap.get() == NULL) + if (m_is_file || m_opaque_ap == NULL) return 0; return static_cast<StreamString *>(m_opaque_ap.get())->GetSize(); @@ -59,7 +59,7 @@ void SBStream::RedirectToFile(const char *path, bool append) { return; std::string local_data; - if (m_opaque_ap.get()) { + if (m_opaque_ap) { // See if we have any locally backed data. If so, copy it so we can then // redirect it to the file so we don't lose the data if (!m_is_file) @@ -76,7 +76,7 @@ void SBStream::RedirectToFile(const char *path, bool append) { open_options); m_opaque_ap.reset(stream_file); - if (m_opaque_ap.get()) { + if (m_opaque_ap) { m_is_file = true; // If we had any data locally in our StreamString, then pass that along to @@ -92,7 +92,7 @@ void SBStream::RedirectToFileHandle(FILE *fh, bool transfer_fh_ownership) { return; std::string local_data; - if (m_opaque_ap.get()) { + if (m_opaque_ap) { // See if we have any locally backed data. If so, copy it so we can then // redirect it to the file so we don't lose the data if (!m_is_file) @@ -100,7 +100,7 @@ void SBStream::RedirectToFileHandle(FILE *fh, bool transfer_fh_ownership) { } m_opaque_ap.reset(new StreamFile(fh, transfer_fh_ownership)); - if (m_opaque_ap.get()) { + if (m_opaque_ap) { m_is_file = true; // If we had any data locally in our StreamString, then pass that along to @@ -113,7 +113,7 @@ void SBStream::RedirectToFileHandle(FILE *fh, bool transfer_fh_ownership) { void SBStream::RedirectToFileDescriptor(int fd, bool transfer_fh_ownership) { std::string local_data; - if (m_opaque_ap.get()) { + if (m_opaque_ap) { // See if we have any locally backed data. If so, copy it so we can then // redirect it to the file so we don't lose the data if (!m_is_file) @@ -121,7 +121,7 @@ void SBStream::RedirectToFileDescriptor(int fd, bool transfer_fh_ownership) { } m_opaque_ap.reset(new StreamFile(::fdopen(fd, "w"), transfer_fh_ownership)); - if (m_opaque_ap.get()) { + if (m_opaque_ap) { m_is_file = true; // If we had any data locally in our StreamString, then pass that along to @@ -137,13 +137,13 @@ lldb_private::Stream *SBStream::operator->() { return m_opaque_ap.get(); } lldb_private::Stream *SBStream::get() { return m_opaque_ap.get(); } lldb_private::Stream &SBStream::ref() { - if (m_opaque_ap.get() == NULL) + if (m_opaque_ap == NULL) m_opaque_ap.reset(new StreamString()); - return *m_opaque_ap.get(); + return *m_opaque_ap; } void SBStream::Clear() { - if (m_opaque_ap.get()) { + if (m_opaque_ap) { // See if we have any locally backed data. If so, copy it so we can then // redirect it to the file so we don't lose the data if (m_is_file) |

