Re: PeerInfo and PeerId

Hi Peter,

The only thing I noted was that instead of implementing the custom function getPeerIdFromPeerInfo() we could use the new Uri::queryItemValue (const QByteArray &key) which will return the value associated with the key or a QByteArray() is none is associated.

Agreed - I’ve written that member function and replace the custom function with it. See changeset for more details.

Btw, what is your opinion about the TrackerRequestWriter::getPathForHttpHeader() function and the \todo there?

Btw, I liked that one:

Q_ASSERT (false && “peerInfo does not contain peer ID!”);

I think I’ll be writing my Q_ASSERT (false) like this from now on! :-)

I think that it’s more presentive than just Q_ASSERT (false). Btw I’ve been thinking whether it’s better to use

Q_ASSERT (false && “peerInfo does not contain peer ID!”);

or

Q_ASSERT (!“peerInfo does not contain peer ID!”);

Both of them does the same job, but the former seems to me more obvious/comprehensible.

Have a nice day,

Petr

Would you like to post a relpy?


This post is a reply to:
Re: PeerInfo and PeerId
Hi Petr, The revision looks pretty good! The only thing I noted was that instead of implementing the custom function getPeerIdFromPeerInfo() we could use the new Uri::queryItemValue (const QByteArray &key) which (more...)

Follow-ups:
Re: PeerInfo and PeerId
Hi Petr, Btw, what is your opinion about the TrackerRequestWriter::getPathForHttpHeader() function and the \todo there? Sorry I've overseen that! I actually only checked the changeset and not all the source code. Now (more...)