[nautilus/wip/antoniof/local_vs_native_fixup: 154/157] directory: Replace obsolete early return with precondition
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/antoniof/local_vs_native_fixup: 154/157] directory: Replace obsolete early return with precondition
- Date: Mon, 14 Dec 2020 19:00:50 +0000 (UTC)
commit 4efcb028afa477f4352a0b8613914102c8f034f3
Author: António Fernandes <antoniof gnome org>
Date: Sat May 16 23:54:56 2020 +0100
directory: Replace obsolete early return with precondition
The early "return TRUE;" was added because gnome-vfs didn't have a way
to represent all URIs: 5baaa578051f2f1249a518c256d84d04f221011a
When nautilus was ported to GIO, this early return was kept despite
GnomeVFSURI being superceeded by GFile, which can represent any URI:
469047a2a58430026d68a3b99b223b922b18b8d1
This early return should never happen, because a non-NULL location
is always set.
src/nautilus-directory.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
---
diff --git a/src/nautilus-directory.c b/src/nautilus-directory.c
index d9a91904e..de7cb4ead 100644
--- a/src/nautilus-directory.c
+++ b/src/nautilus-directory.c
@@ -780,11 +780,7 @@ nautilus_directory_is_local_or_fuse (NautilusDirectory *directory)
g_autofree char *path = NULL;
g_return_val_if_fail (NAUTILUS_IS_DIRECTORY (directory), FALSE);
-
- if (directory->details->location == NULL)
- {
- return TRUE;
- }
+ g_return_val_if_fail (directory->details->location, FALSE);
/* If the glib reports a path, then it can use FUSE to convert the uri
* to a local path
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]