private Scalar[] getScalars(CodeUnit codeUnit, int opIndex) {
		Scalar cuScalar = codeUnit.getScalar(opIndex);
		if (cuScalar != null) {
			return new Scalar[] { cuScalar };
		}
		ArrayList<Scalar> list = new ArrayList<>();
		if (codeUnit instanceof Instruction) {
			Object[] objs = ((Instruction) codeUnit).getOpObjects(opIndex);
			for (int index = 0; index < objs.length; index++) {
				if (index >= 0 && index < objs.length && objs[index] instanceof Scalar) {
					Scalar scalar = (Scalar) objs[index];
					if (!list.contains(scalar)) {
						list.add(scalar);
					}
				}
			}
		}
		return list.toArray(new Scalar[list.size()]);
	}
Gets an array with all the scalar values at a code unit and operand index.
There can be multiple sub-operands and therefore multiple scalars for an operand.
@param codeUnit the code unit
@param opIndex the index of the operand
@return the array of scalars.
Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/EquateMerger.java