(&mut self, constant: Constant)
| 138 | self.pool |
| 139 | } |
| 140 | |
| 141 | pub(super) fn add(&mut self, constant: Constant<'static>) -> jvm::Result<u16> { |
| 142 | let key = ConstantKey::from(&constant); |
| 143 | if let Some(index) = self.constants.get(&key) { |
| 144 | return Ok(*index); |
| 145 | } |
| 146 | let index = self.pool.add(constant)?; |
| 147 | self.constants.insert(key, index); |
| 148 | Ok(index) |
| 149 | } |
| 150 | |
| 151 | pub(super) fn add_utf8<S: AsRef<str>>(&mut self, value: S) -> jvm::Result<u16> { |
no outgoing calls
no test coverage detected