MCPcopy Create free account
hub / github.com/cretz/stackparam / class_const

Function class_const

src/manip.rs:270–285  ·  view source on GitHub ↗
(class_file: &mut Classfile, class_name: &str)

Source from the content-addressed store, hash-verified

268}
269
270fn class_const(class_file: &mut Classfile, class_name: &str) -> usize {
271 let utf8_idx = utf8_const(class_file, class_name);
272 for i in 0..class_file.constant_pool.constants.len() {
273 match class_file.constant_pool.constants[i] {
274 Constant::Class(ref idx) => {
275 if idx.idx == utf8_idx {
276 return i;
277 }
278 },
279 _ => ()
280 }
281 }
282 let ret = class_file.constant_pool.constants.len();
283 class_file.constant_pool.constants.push(Constant::Class(ConstantPoolIndex { idx: utf8_idx }));
284 return ret;
285}
286
287#[allow(dead_code)]
288fn name_and_type_const(class_file: &mut Classfile, name: &str, desc: &str) -> usize {

Callers 2

field_ref_constFunction · 0.85
method_ref_constFunction · 0.85

Calls 2

utf8_constFunction · 0.85
lenMethod · 0.80

Tested by

no test coverage detected