File tree 1 file changed +2
-11
lines changed
1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -1950,16 +1950,7 @@ impl IdMap {
1950
1950
1951
1951
pub ( crate ) fn derive < S : AsRef < str > + ToString > ( & mut self , candidate : S ) -> String {
1952
1952
let id = match self . map . get_mut ( candidate. as_ref ( ) ) {
1953
- None => {
1954
- let candidate = candidate. to_string ( ) ;
1955
- if self . defined_ids . contains ( candidate. as_str ( ) ) {
1956
- let id = format ! ( "{}-{}" , candidate, 1 ) ;
1957
- self . map . insert ( candidate. into ( ) , 2 ) ;
1958
- id
1959
- } else {
1960
- candidate. to_string ( )
1961
- }
1962
- }
1953
+ None => candidate. to_string ( ) ,
1963
1954
Some ( a) => {
1964
1955
let id = format ! ( "{}-{}" , candidate. as_ref( ) , * a) ;
1965
1956
* a += 1 ;
@@ -1981,7 +1972,7 @@ impl IdMap {
1981
1972
}
1982
1973
1983
1974
pub ( crate ) fn clear ( & mut self ) {
1984
- self . map . clear ( ) ;
1975
+ self . map = self . defined_ids . clone ( ) ;
1985
1976
self . existing_footnotes = 0 ;
1986
1977
}
1987
1978
}
You can’t perform that action at this time.
0 commit comments