@@ -11,15 +11,15 @@ use std::ffi::OsString;
1111use std:: fs:: File ;
1212use std:: io:: { self , BufRead , BufReader } ;
1313use string_interner:: StringInterner ;
14- use string_interner:: backend:: StringBackend ;
14+ use string_interner:: backend:: BucketBackend ;
1515use thiserror:: Error ;
1616use uucore:: display:: Quotable ;
1717use uucore:: error:: { UError , UResult , USimpleError } ;
1818use uucore:: { format_usage, show, translate} ;
1919
2020// short types for switching interning behavior on the fly.
21- type Sym = string_interner:: symbol:: SymbolU32 ;
22- type Interner = StringInterner < StringBackend < Sym > > ;
21+ type Sym = string_interner:: symbol:: SymbolUsize ;
22+ type Interner = StringInterner < BucketBackend < Sym > > ;
2323
2424mod options {
2525 pub const FILE : & str = "file" ;
@@ -59,6 +59,8 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
5959 if input == "-" {
6060 process_input ( io:: stdin ( ) . lock ( ) , & mut g) ?;
6161 } else {
62+ // Windows reports a permission denied error when trying to read a directory.
63+ // So we check manually beforehand. On other systems, we avoid this extra check for performance.
6264 #[ cfg( windows) ]
6365 {
6466 use std:: path:: Path ;
@@ -88,9 +90,9 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
8890 use std:: os:: unix:: io:: AsFd ;
8991
9092 posix_fadvise (
91- file. as_fd ( ) , // file descriptor
92- 0 , // start of the file
93- 0 , // length 0 = all
93+ file. as_fd ( ) ,
94+ 0 , // offset 0 => from the start of the file
95+ 0 , // length 0 => for the whole file
9496 PosixFadviseAdvice :: POSIX_FADV_SEQUENTIAL ,
9597 )
9698 . ok ( ) ;
0 commit comments