Prevent loading of directory.css on every page

i am using an old drupal version
i noticed that directory.css is loaded on every single page of the site even though it’s only needed for the directory pages

inside the directory module i found those lines:

  if (!$may_cache) {
    // inject our css per and
    drupal_set_html_head(theme('stylesheet_import', base_path() . drupal_get_path('module', 'directory') .'/directory.css'));

How do i modify them to make directory.css load on the directory pages only?
am i looking at the right part of code?

Drupal version: