BR: Misleading return value for File::moveFileTo

I came across a small wrinkle in the JUCE File class today. The moveFileTo method returns a bool, and the docs describe the return type as “returns true if the operation succeeds”. By this, I understand “returns true if the file is moved to the new location.” However, for this to be true, the code needs to be re-ordered.

The current function:

bool File::moveFileTo (const File& newFile) const
    if (newFile.fullPath == fullPath)
        return true;

    if (! exists())
        return false;

    if (*this != newFile)
        if (! newFile.deleteFile())
            return false;

    return moveInternal (newFile);

The function as written intends to return false (no file was moved) if the file does not exist, but will return true if the file does not exist, but the newFile path is the same as the old one. I think the check for the file existing should be before the check for the paths being the same.