File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -1950,16 +1950,7 @@ impl IdMap {
19501950
19511951 pub ( crate ) fn derive < S : AsRef < str > + ToString > ( & mut self , candidate : S ) -> String {
19521952 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 ( ) ,
19631954 Some ( a) => {
19641955 let id = format ! ( "{}-{}" , candidate. as_ref( ) , * a) ;
19651956 * a += 1 ;
@@ -1981,7 +1972,7 @@ impl IdMap {
19811972 }
19821973
19831974 pub ( crate ) fn clear ( & mut self ) {
1984- self . map . clear ( ) ;
1975+ self . map = self . defined_ids . clone ( ) ;
19851976 self . existing_footnotes = 0 ;
19861977 }
19871978}
You can’t perform that action at this time.
0 commit comments