In path.module lines 87 to 89 are

$alias = path_load($pid);
drupal_set_title($alias['dst']);
$output = path_form(path_load($pid));

so path_load is called the second time although the content is already in $alias.
path_load simply does

return db_fetch_array(db_query('SELECT * FROM {url_alias} WHERE pid = %d', $pid));

So this is basically an unnecessary duplicate db_query. This is absolutely minor, because it only gets called on edit.

CommentFileSizeAuthor
#2 unnecessary_query.patch562 bytesflk
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

scroogie’s picture

Title: Unnecessary db_query » Unnecessary db_query in path.module

Changing Title, sorry.

flk’s picture

Status: Active » Needs review
FileSize
562 bytes

reused $alias rather than calling path_load 2nd time.

moshe weitzman’s picture

Version: x.y.z » 5.x-dev
Status: Needs review » Reviewed & tested by the community

of course. RTBC.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Good catch! :)

Anonymous’s picture

Status: Fixed » Closed (fixed)