private void removePrimaryReference() {
		EquateTable equateTable = program.getEquateTable();
		List<Equate> equates = equateTable.getEquates(convertAddress);
		for (Equate equate : equates) {
			List<EquateReference> references = equate.getReferences(convertAddress);
			for (EquateReference ref : references) {
				if (ref.getDynamicHashValue() == convertHash) {
					if (equate.getReferenceCount() <= 1) {
						equateTable.removeEquate(equate.getName());
					}
					else {
						equate.removeReference(convertHash, convertAddress);
					}
					return;
				}
			}
		}
	}
Remove any pre-existing equate reference with the same address and hash as the
primate equate.
Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/ConvertConstantTask.java