Changeset 22645


Ignore:
Timestamp:
03/28/18 13:43:13 (7 years ago)
Author:
Mathieu Morlighem
Message:

CHG: improved speed of issmdir by calling mfilename instead of which

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/os/issmdir.m

    r20382 r22645  
    77%Initialize output ISSM_DIR
    88ISSM_DIR='';
    9 slash=filesep();
    109
    1110%Get ISSM_DIR from function path (we do not want to force users to edit their bashrc)
    12 path=which('issmdir');
     11path = mfilename('fullpath');
    1312
    1413%issmdir might be in bin,
    15 pos=strfind(path,['bin' slash 'issmdir.m']);
     14slash = filesep();
     15pos   = strfind(path,['bin' slash 'issmdir']);
    1616if ~isempty(pos),
    1717        ISSM_DIR=path(1:pos-1);
    1818else
    19         pos=strfind(path,['src' slash 'm' slash 'os' slash 'issmdir.m']);
     19        pos=strfind(path,['src' slash 'm' slash 'os' slash 'issmdir']);
    2020        if ~isempty(pos),
    2121                ISSM_DIR=path(1:pos-1);
Note: See TracChangeset for help on using the changeset viewer.