Browse Source

Fixed local variable shadowing

Paul-Louis Ageneau 4 years ago
parent
commit
7ac351d1b9
2 changed files with 3 additions and 3 deletions
  1. 2 2
      src/candidate.cpp
  2. 1 1
      src/peerconnection.cpp

+ 2 - 2
src/candidate.cpp

@@ -117,9 +117,9 @@ void Candidate::parse(string candidate) {
 		mTransportType = TransportType::Udp;
 		mTransportType = TransportType::Udp;
 	} else if (transport == "TCP" || transport == "tcp") {
 	} else if (transport == "TCP" || transport == "tcp") {
 		// Peek tail to find TCP type
 		// Peek tail to find TCP type
-		std::istringstream iss(mTail);
+		std::istringstream tiss(mTail);
 		string tcptype_, tcptype;
 		string tcptype_, tcptype;
-		if (iss >> tcptype_ >> tcptype && tcptype_ == "tcptype") {
+		if (tiss >> tcptype_ >> tcptype && tcptype_ == "tcptype") {
 			if (auto it = TcpTypeMap.find(tcptype); it != TcpTypeMap.end())
 			if (auto it = TcpTypeMap.find(tcptype); it != TcpTypeMap.end())
 				mTransportType = it->second;
 				mTransportType = it->second;
 			else
 			else

+ 1 - 1
src/peerconnection.cpp

@@ -1137,7 +1137,7 @@ void PeerConnection::processRemoteCandidate(Candidate candidate) {
 	} else {
 	} else {
 		// We might need a lookup, do it asynchronously
 		// We might need a lookup, do it asynchronously
 		// We don't use the thread pool because we have no control on the timeout
 		// We don't use the thread pool because we have no control on the timeout
-		if (auto iceTransport = std::atomic_load(&mIceTransport)) {
+		if ((iceTransport = std::atomic_load(&mIceTransport))) {
 			weak_ptr<IceTransport> weakIceTransport{iceTransport};
 			weak_ptr<IceTransport> weakIceTransport{iceTransport};
 			std::thread t([weakIceTransport, candidate = std::move(candidate)]() mutable {
 			std::thread t([weakIceTransport, candidate = std::move(candidate)]() mutable {
 				if (candidate.resolve(Candidate::ResolveMode::Lookup))
 				if (candidate.resolve(Candidate::ResolveMode::Lookup))