summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/path.inc8
1 files changed, 3 insertions, 5 deletions
diff --git a/includes/path.inc b/includes/path.inc
index 0a791cc01..b911dae60 100644
--- a/includes/path.inc
+++ b/includes/path.inc
@@ -42,10 +42,10 @@ function drupal_init_path() {
function drupal_lookup_path($action, $path = '') {
// $map keys are Drupal paths and the values are the corresponding aliases
static $map = array(), $no_src = array();
- static $count = NULL;
+ static $count;
// Use $count to avoid looking up paths in subsequent calls if there simply are no aliases
- if ($count === NULL) {
+ if (!isset($count)) {
$count = db_result(db_query('SELECT COUNT(pid) FROM {url_alias}'));
}
@@ -58,9 +58,7 @@ function drupal_lookup_path($action, $path = '') {
if (isset($map[$path])) {
return $map[$path];
}
- if (!$alias = db_result(db_query("SELECT dst FROM {url_alias} WHERE src = '%s'", $path))) {
- $alias = FALSE;
- }
+ $alias = db_result(db_query("SELECT dst FROM {url_alias} WHERE src = '%s'", $path));
$map[$path] = $alias;
return $alias;
}