jiridanek commented on a change in pull request #303:
URL: https://github.com/apache/qpid-proton/pull/303#discussion_r612800966



##########
File path: cpp/src/url.cpp
##########
@@ -274,14 +274,10 @@ std::string to_string(const url& u) {
 std::istream& operator>>(std::istream& i, url& u) {
     std::string s;
     i >> s;
-    if (!i.fail() && !i.bad()) {
-        if (!s.empty()) {
-            url::impl* p = new url::impl(s);
-            p->defaults();
-            u.impl_.reset(p);
-        } else {
-            i.clear(std::ios::failbit);
-        }
+    if (!i.fail()) {

Review comment:
       ```suggestion
       if (i) {
   ```
   
   I think that this makes the most sense. It has the same meaning as 
`!i.fail() && !i.bad()`, according to 
https://www.cplusplus.com/reference/ios/ios/operator_bool/ and it is shorter. 
But tbh, I never really worked with C++ streams, so I may be missing something.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to