@@ -31,7 +31,7 @@ class Packages {
3131          uri, "uri" , "Path must not start with '/'." );
3232    }
3333    // Normalizes the path by removing '.' and '..' segments. 
34-     uri =  _normalizePath ( uri);
34+     uri =  uri. normalizePath ( );
3535    String  path =  uri.path;
3636    var  slashIndex =  path.indexOf ('/' );
3737    String  packageName;
@@ -51,10 +51,6 @@ class Packages {
5151    return  packageLocation.resolveUri (new  Uri (path:  rest));
5252  }
5353
54-   /// A stand in for uri.normalizePath(), coming in 1.11 
55- static  Uri  _normalizePath (Uri  existingUri) => 
56-       new  Uri ().resolveUri (existingUri);
57- 
5854  /// Parses a `packages.cfg`  file into a `Packages`  object. 
5955  /// 
6056  /// The [baseLocation]  is used as a base URI to resolve all relative 
@@ -189,12 +185,12 @@ class Packages {
189185      }
190186    }
191187
192-     baseUri =  _normalizePath ( baseUri);
188+     baseUri =  baseUri. normalizePath ( );
193189    List <String > base  =  baseUri.pathSegments.toList ();
194190    if  (base .isNotEmpty) {
195191      base  =  new  List <String >.from (base )..removeLast ();
196192    }
197-     uri =  _normalizePath ( uri);
193+     uri =  uri. normalizePath ( );
198194    List <String > target =  uri.pathSegments.toList ();
199195    int  index =  0 ;
200196    while  (index <  base .length &&  index <  target.length) {
0 commit comments