瀏覽代碼

trivial rename

David Rose 16 年之前
父節點
當前提交
712797797e
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      dtool/src/dtoolutil/filename.cxx

+ 6 - 0
dtool/src/dtoolutil/filename.cxx

@@ -2405,6 +2405,12 @@ unlink() const {
 bool Filename::
 bool Filename::
 rename_to(const Filename &other) const {
 rename_to(const Filename &other) const {
   assert(!get_pattern());
   assert(!get_pattern());
+
+  if (*this == other) {
+    // Trivial success.
+    return true;
+  }
+
   string os_specific = to_os_specific();
   string os_specific = to_os_specific();
   string other_os_specific = other.to_os_specific();
   string other_os_specific = other.to_os_specific();