def marc_clean_subfields(field, inplace=True):
    """
    Given a pymarc.field.Field, return a list of subfields, without empty
    values or perform modification in place.
    """
    cleaned_subfields = []
    it = iter(field.subfields)
    for code, value in zip(it, it):
        if not value:
            continue
        cleaned_subfields.append(code)
        cleaned_subfields.append(value)
    if inplace:
        field.subfields = cleaned_subfields
    else:
        return cleaned_subfields
